aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichaël Cadilhac2007-08-31 13:41:31 +0000
committerMichaël Cadilhac2007-08-31 13:41:31 +0000
commit08fea928870ca809d9d4cae2b6b9f829cb6280b4 (patch)
treead2f7e9aebdf0624d04b046a25163934e591e2a5 /lisp
parent661e8cd19ba9e136fbe61f0b728c05e9226da9ea (diff)
downloademacs-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')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/textmodes/flyspell.el17
2 files changed, 22 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6a3447dc01e..255aad43bc4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
12007-08-31 Micha,Ak(Bl Cadilhac <michael@cadilhac.name> 12007-08-31 Micha,Ak(Bl Cadilhac <michael@cadilhac.name>
2 2
3 * textmodes/flyspell.el (flyspell-mark-duplications-exceptions):
4 New variable. List of exceptions for the duplicated word rule.
5 (flyspell-mark-duplications-flag): Mention it.
6 (flyspell-word): Treat it.
7
3 * files.el (create-file-buffer): If the filename sans directory starts 8 * files.el (create-file-buffer): If the filename sans directory starts
4 with spaces, remove them. 9 with spaces, remove them.
5 10
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.
70See `flyspell-mark-duplications-exceptions' to add exceptions to this rule.
70Detection of repeated words is not implemented in 71Detection 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.
79It should be a list of (LANGUAGE . EXCEPTION-LIST). LANGUAGE is matched
80against the current dictionary and EXCEPTION-LIST is a list of strings.
81The 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