aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/textmodes/flyspell.el34
2 files changed, 31 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 04353b9137c..fe429f6f161 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12011-04-03 Chong Yidong <cyd@stupidchicken.com>
2
3 * textmodes/flyspell.el (flyspell-word): Recognize default
4 dictionary case for flyspell-mark-duplications-exceptions. Use
5 regexp matching for languages.
6 (flyspell-mark-duplications-exceptions): Add "that" and "had" for
7 default dictionary (Bug#7926).
8
12011-04-02 Chong Yidong <cyd@stupidchicken.com> 92011-04-02 Chong Yidong <cyd@stupidchicken.com>
2 10
3 * emacs-lisp/package.el (package--with-work-buffer): Recognize 11 * emacs-lisp/package.el (package--with-work-buffer): Recognize
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 3c9a4570248..99c9a83e4fb 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -71,13 +71,23 @@ Detection of repeated words is not implemented in
71 :type 'boolean) 71 :type 'boolean)
72 72
73(defcustom flyspell-mark-duplications-exceptions 73(defcustom flyspell-mark-duplications-exceptions
74 '(("francais" . ("nous" "vous"))) 74 '((nil . ("that" "had")) ; Common defaults for English.
75 ("\\`francais" . ("nous" "vous")))
75 "A list of exceptions for duplicated words. 76 "A list of exceptions for duplicated words.
76It should be a list of (LANGUAGE . EXCEPTION-LIST). LANGUAGE is matched 77It should be a list of (LANGUAGE . EXCEPTION-LIST).
77against the current dictionary and EXCEPTION-LIST is a list of strings. 78
78The duplicated word is downcased before it is compared with the exceptions." 79LANGUAGE is nil, which means the exceptions apply regardless of
80the current dictionary, or a regular expression matching the
81dictionary name (`ispell-local-dictionary' or
82`ispell-dictionary') for which the exceptions should apply.
83
84EXCEPTION-LIST is a list of strings. The checked word is
85downcased before comparing with these exceptions."
79 :group 'flyspell 86 :group 'flyspell
80 :type '(alist :key-type string :value-type (repeat string))) 87 :type '(alist :key-type (choice (const :tag "All dictionaries" nil)
88 string)
89 :value-type (repeat string))
90 :version "24.1")
81 91
82(defcustom flyspell-sort-corrections nil 92(defcustom flyspell-sort-corrections nil
83 "Non-nil means, sort the corrections alphabetically before popping them." 93 "Non-nil means, sort the corrections alphabetically before popping them."
@@ -1044,12 +1054,14 @@ misspelling and skips redundant spell-checking step."
1044 (not (memq (char-after (1- start)) '(?\} ?\\))))) 1054 (not (memq (char-after (1- start)) '(?\} ?\\)))))
1045 flyspell-mark-duplications-flag 1055 flyspell-mark-duplications-flag
1046 (not (catch 'exception 1056 (not (catch 'exception
1047 (dolist (except flyspell-mark-duplications-exceptions) 1057 (let ((dict (or ispell-local-dictionary
1048 (and (string= (or ispell-local-dictionary 1058 ispell-dictionary)))
1049 ispell-dictionary) 1059 (dolist (except flyspell-mark-duplications-exceptions)
1050 (car except)) 1060 (and (or (null (car except))
1051 (member (downcase word) (cdr except)) 1061 (and (stringp dict)
1052 (throw 'exception t))))) 1062 (string-match (car except) dict)))
1063 (member (downcase word) (cdr except))
1064 (throw 'exception t))))))
1053 (save-excursion 1065 (save-excursion
1054 (goto-char start) 1066 (goto-char start)
1055 (let* ((bound 1067 (let* ((bound