]> git.eshelyaron.com Git - emacs.git/commitdiff
Make `ispell-change-dictionary' only list installed dictionaries
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 28 Jul 2019 10:26:01 +0000 (12:26 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 28 Jul 2019 10:26:08 +0000 (12:26 +0200)
* lisp/textmodes/ispell.el (ispell-find-aspell-dictionaries): If
the backend (i.e., aspell/hunspell) provided a list of languages,
don't add the base list (bug#24050).
(ispell-set-spellchecker-params): Ditto.

lisp/textmodes/ispell.el

index 9dfa9f3c4483f7724eb20fb6f2c00ad36fc5f005..0c7fb3899ed8c96f2282e7c508e45468fa68e810 100644 (file)
@@ -851,11 +851,13 @@ Internal use.")
     ;; 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-base-alist
-    ;; which have no element in FOUND at all.
-    (dolist (dict ispell-dictionary-base-alist)
-      (unless (assoc (car dict) found)
-       (setq found (nconc found (list dict)))))
+    ;; Merge into FOUND any elements from the standard
+    ;; ispell-dictionary-base-alist which have no element in FOUND at
+    ;; all.
+    (unless found
+      (dolist (dict ispell-dictionary-base-alist)
+        (unless (assoc (car dict) found)
+         (setq found (nconc found (list dict))))))
     (setq ispell-aspell-dictionary-alist found)
     ;; Add a default entry
     (let ((default-dict
@@ -1295,8 +1297,7 @@ aspell is used along with Emacs).")
     ;; Substitute ispell-dictionary-alist with the list of
     ;; dictionaries corresponding to the given spellchecker.
     ;; With programs that support it, use the list of really
-    ;; installed dictionaries and add to it elements of the original
-    ;; list that are not present there. Allow distro info.
+    ;; installed dictionaries. Allow distro info.
     (let ((found-dicts-alist
           (if ispell-encoding8-command
                (if ispell-really-aspell
@@ -1363,7 +1364,9 @@ aspell is used along with Emacs).")
       ;; Add dicts to `ispell-dictionary-alist' unless already present.
       (dolist (dict (append found-dicts-alist
                            ispell-base-dicts-override-alist
-                           ispell-dictionary-base-alist))
+                           (if found-dicts-alist
+                                nil
+                              ispell-dictionary-base-alist)))
        (unless (assoc (car dict) all-dicts-alist)
          (push dict all-dicts-alist)))
       (setq ispell-dictionary-alist all-dicts-alist))