emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/spell-fu ae4504f14d 07/86: Fix using hard coded en_US dict


From: ELPA Syncer
Subject: [nongnu] elpa/spell-fu ae4504f14d 07/86: Fix using hard coded en_US dictionary
Date: Thu, 7 Jul 2022 12:03:38 -0400 (EDT)

branch: elpa/spell-fu
commit ae4504f14deb3376ea9d393e5458dcde6f380c0c
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

    Fix using hard coded en_US dictionary
---
 readme.rst  |  9 +++++++--
 spell-fu.el | 17 +++++++++++++++--
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/readme.rst b/readme.rst
index 1921e274b5..b2fcd6f11a 100644
--- a/readme.rst
+++ b/readme.rst
@@ -108,6 +108,13 @@ Other Settings
 
 Some settings are used which aren't part of this package:
 
+``ispell-program-name``
+   Used to call aspell (when this points to ``aspell``, otherwise ``aspell`` 
is called).
+
+``ispell-dictionary``
+   When generating the word-list, this variable is used when present,
+   otherwise aspell's default dictionary is used.
+
 ``ispell-personal-dictionary``
    When generating the word-list, this file is included when present.
 
@@ -134,5 +141,3 @@ TODO
 ====
 
 - Support alternates to ``aspell`` for generating word lists.
-- Currently generating the initial word-list is hard-coded to ``en_US``,
-  this should read the users dictionary type.
diff --git a/spell-fu.el b/spell-fu.el
index ebd69bfca1..e5e186cb77 100644
--- a/spell-fu.el
+++ b/spell-fu.el
@@ -251,8 +251,21 @@ Argument WORDS-FILE the file to write the word list into."
           (unless (eq ?\n (char-after))
             (insert "\n")))
 
-        ;; TODO: make dictionary configurable.
-        (call-process (executable-find "aspell") nil t nil "-d" "en_US" "dump" 
"master")
+        (let
+          ( ;; Use the pre-configured aspell binary, or call aspell directly.
+            (aspell-bin
+              (or
+                (and
+                  (bound-and-true-p ispell-really-aspell)
+                  (bound-and-true-p ispell-program-name))
+                (executable-find "aspell")))
+            (dict (spell-fu--dictionary)))
+
+          (cond
+            ((string-equal dict "default")
+              (call-process aspell-bin nil t nil "dump" "master"))
+            (t
+              (call-process aspell-bin nil t nil "-d" dict "dump" "master"))))
 
         ;; Case insensitive sort is important if this is used for 
`ispell-complete-word-dict'.
         ;; Which is a handy double-use for this file.



reply via email to

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