diff options
| author | Michaël Cadilhac | 2007-08-31 13:41:31 +0000 |
|---|---|---|
| committer | Michaël Cadilhac | 2007-08-31 13:41:31 +0000 |
| commit | 08fea928870ca809d9d4cae2b6b9f829cb6280b4 (patch) | |
| tree | ad2f7e9aebdf0624d04b046a25163934e591e2a5 /lisp/textmodes | |
| parent | 661e8cd19ba9e136fbe61f0b728c05e9226da9ea (diff) | |
| download | emacs-08fea928870ca809d9d4cae2b6b9f829cb6280b4.tar.gz emacs-08fea928870ca809d9d4cae2b6b9f829cb6280b4.zip | |
(flyspell-mark-duplications-exceptions): New variable. List of
exceptions for the duplicated word rule.
(flyspell-mark-duplications-flag): Mention it.
(flyspell-word): Treat it.
Diffstat (limited to 'lisp/textmodes')
| -rw-r--r-- | lisp/textmodes/flyspell.el | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 0b5dfa4cc54..9d5c7868d13 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el | |||
| @@ -67,11 +67,21 @@ Non-nil means use highlight, nil means use minibuffer messages." | |||
| 67 | 67 | ||
| 68 | (defcustom flyspell-mark-duplications-flag t | 68 | (defcustom flyspell-mark-duplications-flag t |
| 69 | "Non-nil means Flyspell reports a repeated word as an error. | 69 | "Non-nil means Flyspell reports a repeated word as an error. |
| 70 | See `flyspell-mark-duplications-exceptions' to add exceptions to this rule. | ||
| 70 | Detection of repeated words is not implemented in | 71 | Detection of repeated words is not implemented in |
| 71 | \"large\" regions; see `flyspell-large-region'." | 72 | \"large\" regions; see `flyspell-large-region'." |
| 72 | :group 'flyspell | 73 | :group 'flyspell |
| 73 | :type 'boolean) | 74 | :type 'boolean) |
| 74 | 75 | ||
| 76 | (defcustom flyspell-mark-duplications-exceptions | ||
| 77 | '(("francais" . ("nous" "vous"))) | ||
| 78 | "A list of exceptions for duplicated words. | ||
| 79 | It should be a list of (LANGUAGE . EXCEPTION-LIST). LANGUAGE is matched | ||
| 80 | against the current dictionary and EXCEPTION-LIST is a list of strings. | ||
| 81 | The duplicated word is downcased before it is compared with the exceptions." | ||
| 82 | :group 'flyspell | ||
| 83 | :type '(alist :key-type string :value-type (repeat string))) | ||
| 84 | |||
| 75 | (defcustom flyspell-sort-corrections nil | 85 | (defcustom flyspell-sort-corrections nil |
| 76 | "Non-nil means, sort the corrections alphabetically before popping them." | 86 | "Non-nil means, sort the corrections alphabetically before popping them." |
| 77 | :group 'flyspell | 87 | :group 'flyspell |
| @@ -1022,6 +1032,13 @@ Mostly we check word delimiters." | |||
| 1022 | (and (> start (point-min)) | 1032 | (and (> start (point-min)) |
| 1023 | (not (memq (char-after (1- start)) '(?\} ?\\))))) | 1033 | (not (memq (char-after (1- start)) '(?\} ?\\))))) |
| 1024 | flyspell-mark-duplications-flag | 1034 | flyspell-mark-duplications-flag |
| 1035 | (not (catch 'exception | ||
| 1036 | (dolist (except flyspell-mark-duplications-exceptions) | ||
| 1037 | (and (string= (or ispell-local-dictionary | ||
| 1038 | ispell-dictionary) | ||
| 1039 | (car except)) | ||
| 1040 | (member (downcase word) (cdr except)) | ||
| 1041 | (throw 'exception t))))) | ||
| 1025 | (save-excursion | 1042 | (save-excursion |
| 1026 | (goto-char start) | 1043 | (goto-char start) |
| 1027 | (let* ((bound | 1044 | (let* ((bound |