aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-07-28 12:26:01 +0200
committerLars Ingebrigtsen2019-07-28 12:26:08 +0200
commit848712b481e16f5c96fed6344c2f7d71a8d52ed1 (patch)
tree771bf854ba66375c7bfae164e2115bb36259fdc5
parent740ab86062e8efd6e402a868b1b7ed808d795c40 (diff)
downloademacs-848712b481e16f5c96fed6344c2f7d71a8d52ed1.tar.gz
emacs-848712b481e16f5c96fed6344c2f7d71a8d52ed1.zip
Make `ispell-change-dictionary' only list installed dictionaries
* 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.
-rw-r--r--lisp/textmodes/ispell.el19
1 files changed, 11 insertions, 8 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 9dfa9f3c448..0c7fb3899ed 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -851,11 +851,13 @@ Internal use.")
851 ;; Ensure aspell's alias dictionary will override standard 851 ;; Ensure aspell's alias dictionary will override standard
852 ;; definitions. 852 ;; definitions.
853 (setq found (ispell-aspell-add-aliases found)) 853 (setq found (ispell-aspell-add-aliases found))
854 ;; Merge into FOUND any elements from the standard ispell-dictionary-base-alist 854 ;; Merge into FOUND any elements from the standard
855 ;; which have no element in FOUND at all. 855 ;; ispell-dictionary-base-alist which have no element in FOUND at
856 (dolist (dict ispell-dictionary-base-alist) 856 ;; all.
857 (unless (assoc (car dict) found) 857 (unless found
858 (setq found (nconc found (list dict))))) 858 (dolist (dict ispell-dictionary-base-alist)
859 (unless (assoc (car dict) found)
860 (setq found (nconc found (list dict))))))
859 (setq ispell-aspell-dictionary-alist found) 861 (setq ispell-aspell-dictionary-alist found)
860 ;; Add a default entry 862 ;; Add a default entry
861 (let ((default-dict 863 (let ((default-dict
@@ -1295,8 +1297,7 @@ aspell is used along with Emacs).")
1295 ;; Substitute ispell-dictionary-alist with the list of 1297 ;; Substitute ispell-dictionary-alist with the list of
1296 ;; dictionaries corresponding to the given spellchecker. 1298 ;; dictionaries corresponding to the given spellchecker.
1297 ;; With programs that support it, use the list of really 1299 ;; With programs that support it, use the list of really
1298 ;; installed dictionaries and add to it elements of the original 1300 ;; installed dictionaries. Allow distro info.
1299 ;; list that are not present there. Allow distro info.
1300 (let ((found-dicts-alist 1301 (let ((found-dicts-alist
1301 (if ispell-encoding8-command 1302 (if ispell-encoding8-command
1302 (if ispell-really-aspell 1303 (if ispell-really-aspell
@@ -1363,7 +1364,9 @@ aspell is used along with Emacs).")
1363 ;; Add dicts to `ispell-dictionary-alist' unless already present. 1364 ;; Add dicts to `ispell-dictionary-alist' unless already present.
1364 (dolist (dict (append found-dicts-alist 1365 (dolist (dict (append found-dicts-alist
1365 ispell-base-dicts-override-alist 1366 ispell-base-dicts-override-alist
1366 ispell-dictionary-base-alist)) 1367 (if found-dicts-alist
1368 nil
1369 ispell-dictionary-base-alist)))
1367 (unless (assoc (car dict) all-dicts-alist) 1370 (unless (assoc (car dict) all-dicts-alist)
1368 (push dict all-dicts-alist))) 1371 (push dict all-dicts-alist)))
1369 (setq ispell-dictionary-alist all-dicts-alist)) 1372 (setq ispell-dictionary-alist all-dicts-alist))