emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103815: Improvements to flyspell-mar


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103815: Improvements to flyspell-mark-duplications-exceptions.
Date: Sun, 03 Apr 2011 16:59:45 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103815
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sun 2011-04-03 16:59:45 -0400
message:
  Improvements to flyspell-mark-duplications-exceptions.
  
  * lisp/textmodes/flyspell.el (flyspell-word): Recognize default
  dictionary case for flyspell-mark-duplications-exceptions.  Use
  regexp matching for languages.
  (flyspell-mark-duplications-exceptions): Add "that" and "had" for
  default dictionary (Bug#7926).
modified:
  lisp/ChangeLog
  lisp/textmodes/flyspell.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-04-02 23:41:03 +0000
+++ b/lisp/ChangeLog    2011-04-03 20:59:45 +0000
@@ -1,3 +1,11 @@
+2011-04-03  Chong Yidong  <address@hidden>
+
+       * textmodes/flyspell.el (flyspell-word): Recognize default
+       dictionary case for flyspell-mark-duplications-exceptions.  Use
+       regexp matching for languages.
+       (flyspell-mark-duplications-exceptions): Add "that" and "had" for
+       default dictionary (Bug#7926).
+
 2011-04-02  Chong Yidong  <address@hidden>
 
        * emacs-lisp/package.el (package--with-work-buffer): Recognize

=== modified file 'lisp/textmodes/flyspell.el'
--- a/lisp/textmodes/flyspell.el        2011-01-25 04:08:28 +0000
+++ b/lisp/textmodes/flyspell.el        2011-04-03 20:59:45 +0000
@@ -71,13 +71,23 @@
   :type 'boolean)
 
 (defcustom flyspell-mark-duplications-exceptions
-  '(("francais" . ("nous" "vous")))
+  '((nil . ("that" "had")) ; Common defaults for English.
+    ("\\`francais" . ("nous" "vous")))
   "A list of exceptions for duplicated words.
-It should be a list of (LANGUAGE . EXCEPTION-LIST).  LANGUAGE is matched
-against the current dictionary and EXCEPTION-LIST is a list of strings.
-The duplicated word is downcased before it is compared with the exceptions."
+It should be a list of (LANGUAGE . EXCEPTION-LIST).
+
+LANGUAGE is nil, which means the exceptions apply regardless of
+the current dictionary, or a regular expression matching the
+dictionary name (`ispell-local-dictionary' or
+`ispell-dictionary') for which the exceptions should apply.
+
+EXCEPTION-LIST is a list of strings.  The checked word is
+downcased before comparing with these exceptions."
   :group 'flyspell
-  :type '(alist :key-type string :value-type (repeat string)))
+  :type '(alist :key-type (choice (const :tag "All dictionaries" nil)
+                                 string)
+               :value-type (repeat string))
+  :version "24.1")
 
 (defcustom flyspell-sort-corrections nil
   "Non-nil means, sort the corrections alphabetically before popping them."
@@ -1044,12 +1054,14 @@
                          (not (memq (char-after (1- start)) '(?\} ?\\)))))
                 flyspell-mark-duplications-flag
                 (not (catch 'exception
-                       (dolist (except flyspell-mark-duplications-exceptions)
-                         (and (string= (or ispell-local-dictionary
-                                           ispell-dictionary)
-                                       (car except))
-                              (member (downcase word) (cdr except))
-                              (throw 'exception t)))))
+                       (let ((dict (or ispell-local-dictionary
+                                       ispell-dictionary)))
+                         (dolist (except flyspell-mark-duplications-exceptions)
+                           (and (or (null (car except))
+                                    (and (stringp dict)
+                                         (string-match (car except) dict)))
+                                (member (downcase word) (cdr except))
+                                (throw 'exception t))))))
                 (save-excursion
                   (goto-char start)
                   (let* ((bound


reply via email to

[Prev in Thread] Current Thread [Next in Thread]