]> git.eshelyaron.com Git - emacs.git/commitdiff
textmodes/ispell.el (ispell-valid-dictionary-list): Simplify logic.
authorAgustín Martín <agustin.martin@hispalinux.es>
Wed, 8 Sep 2010 14:54:00 +0000 (16:54 +0200)
committerAgustín Martín <agustin.martin@hispalinux.es>
Wed, 8 Sep 2010 14:54:00 +0000 (16:54 +0200)
lisp/ChangeLog
lisp/textmodes/ispell.el

index d967bbbd87ee276c26571423fed0a49424b35fd1..ae54fcd784d96d8cb4bc24f4ffcf640c0d2745e9 100644 (file)
@@ -1,3 +1,8 @@
+2010-09-08  Agustín Martín  <agustin.martin@hispalinux.es>
+
+       * textmodes/ispell.el (ispell-valid-dictionary-list):
+       Simplify logic.
+
 2010-09-08  Michael Albinus  <michael.albinus@gmx.de>
 
        Migrate to Tramp 2.2.  Rearrange load dependencies.
index 0e853cc3ccd0528f2dc0888f314adc251e230939..21eeba1a87aa32fedd3ecc172ad34f7c6130a45c 100644 (file)
@@ -1116,26 +1116,24 @@ The variable `ispell-library-directory' defines the library location."
 
   (let ((dicts (append ispell-local-dictionary-alist ispell-dictionary-alist))
        (dict-list (cons "default" nil))
-       name load-dict)
+       name dict-bname)
     (dolist (dict dicts)
       (setq name (car dict)
-           load-dict (car (cdr (member "-d" (nth 5 dict)))))
+           dict-bname (or (car (cdr (member "-d" (nth 5 dict))))
+                          name))
       ;; Include if the dictionary is in the library, or dir not defined.
       (if (and
           name
-          ;; include all dictionaries if lib directory not known.
           ;; For Aspell, we already know which dictionaries exist.
           (or ispell-really-aspell
+              ;; Include all dictionaries if lib directory not known.
+              ;; Same for Hunspell, where ispell-library-directory is nil.
               (not ispell-library-directory)
               (file-exists-p (concat ispell-library-directory
-                                     "/" name ".hash"))
-              (file-exists-p (concat ispell-library-directory "/" name ".has"))
-              (and load-dict
-                   (or (file-exists-p (concat ispell-library-directory
-                                              "/" load-dict ".hash"))
-                       (file-exists-p (concat ispell-library-directory
-                                              "/" load-dict ".has"))))))
-         (setq dict-list (cons name dict-list))))
+                                     "/" dict-bname ".hash"))
+              (file-exists-p (concat ispell-library-directory
+                                     "/" dict-bname ".has"))))
+         (push name dict-list)))
     dict-list))
 
 ;;; define commands in menu in opposite order you want them to appear.