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

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

[elpa] externals/jinx 10ba4a23f0 1/3: Preserve alist of loaded dictionar


From: ELPA Syncer
Subject: [elpa] externals/jinx 10ba4a23f0 1/3: Preserve alist of loaded dictionaries
Date: Sun, 22 Dec 2024 07:02:50 -0500 (EST)

branch: externals/jinx
commit 10ba4a23f089191755dcb980df275bf49df3aaa1
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Preserve alist of loaded dictionaries
---
 jinx.el | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/jinx.el b/jinx.el
index e6180d1274..9b0a42f825 100644
--- a/jinx.el
+++ b/jinx.el
@@ -329,6 +329,9 @@ Predicate may return a position to skip forward.")
 (defvar-local jinx--dicts nil
   "List of dictionaries.")
 
+(defvar jinx--dicts-alist nil
+  "Alist of all loaded dictionaries.")
+
 (defvar-local jinx--syntax-table nil
   "Syntax table used during checking.
 The table inherits from `jinx--base-syntax-table'.  The table is
@@ -853,8 +856,14 @@ Optionally show prompt INFO and insert INITIAL input."
 
 (defun jinx--load-dicts ()
   "Load dictionaries and setup syntax table."
-  (setq jinx--dicts (delq nil (mapcar #'jinx--mod-dict
-                                      (split-string jinx-languages)))
+  (setq jinx--dicts (cl-loop for lang in (split-string jinx-languages)
+                             ;; Keep a reference to all loaded dictionaries.
+                             ;; See <gh:rrthomas/enchant#402>.
+                             for dict = (or (cdr (assoc lang 
jinx--dicts-alist))
+                                            (when-let ((dict (jinx--mod-dict 
lang)))
+                                              (push (cons lang dict) 
jinx--dicts-alist)
+                                              dict))
+                             if dict collect dict)
         jinx--syntax-table (make-syntax-table jinx--base-syntax-table))
   (unless jinx--dicts
     (message "Jinx: No dictionaries available for %S" jinx-languages))



reply via email to

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