]> git.eshelyaron.com Git - emacs.git/commitdiff
(ispell-find-aspell-dictionaries): Add aliases before merging elements from the
authorEli Zaretskii <eliz@gnu.org>
Sat, 11 Mar 2006 15:36:15 +0000 (15:36 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 11 Mar 2006 15:36:15 +0000 (15:36 +0000)
standard ispell-dictionary-alist.
(ispell-aspell-add-aliases): Add aliases to the passed dictionary alist, and
return the new alist.

lisp/textmodes/ispell.el

index cf82dbdd3db3d83251d485c7638077cacb64aed1..1991a73e8e2d8e747169666f895a0f3f8bf502a8 100644 (file)
@@ -899,14 +899,15 @@ and added as a submenu of the \"Edit\" menu.")
         (found
          (delq nil 
                (mapcar #'ispell-aspell-find-dictionary dictionaries))))
+    ;; Ensure aspell's alias dictionary will override standard
+    ;; definitions.
+    (setq found (ispell-aspell-add-aliases found))
     ;; Merge into FOUND any elements from the standard ispell-dictionary-alist
     ;; which have no element in FOUND at all.    
     (dolist (dict ispell-dictionary-alist)
       (unless (assoc (car dict) found)
        (setq found (nconc found (list dict)))))
     (setq ispell-dictionary-alist found)
-
-    (ispell-aspell-add-aliases)
     ;; Add a default entry
     (let* ((english-dict (assoc "en" ispell-dictionary-alist))
           (default-dict
@@ -973,8 +974,9 @@ Assumes that value contains no whitespace."
       (file-error
        nil))))
 
-(defun ispell-aspell-add-aliases ()
-  "Find aspell's dictionary aliases and add them to `ispell-dictionary-alist'."
+(defun ispell-aspell-add-aliases (alist)
+  "Find aspell's dictionary aliases and add them to dictionary ALIST.
+Return the new dictionary alist."
   (let ((aliases (file-expand-wildcards
                  (concat (or ispell-aspell-dict-dir
                              (setq ispell-aspell-dict-dir
@@ -987,11 +989,12 @@ Assumes that value contains no whitespace."
        (when (search-forward-regexp "^add \\([^.]+\\)\\.multi" nil t)
          (let* ((aliasname (file-name-sans-extension
                             (file-name-nondirectory alias-file)))
-                (already-exists-p (assoc aliasname ispell-dictionary-alist))
+                (already-exists-p (assoc aliasname alist))
                 (realname (match-string 1))
-                (realdict (assoc realname ispell-dictionary-alist)))
+                (realdict (assoc realname alist)))
            (when (and realdict (not already-exists-p))
-             (push (cons aliasname (cdr realdict)) ispell-dictionary-alist))))))))
+             (push (cons aliasname (cdr realdict)) alist))))))
+    alist))
 
 (defun ispell-valid-dictionary-list ()
   "Returns a list of valid dictionaries.