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

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

[elpa] externals/dict-tree 7d9b258 033/154: Improved handling of diction


From: Stefan Monnier
Subject: [elpa] externals/dict-tree 7d9b258 033/154: Improved handling of dictionary file names in dictree-load
Date: Mon, 14 Dec 2020 12:21:38 -0500 (EST)

branch: externals/dict-tree
commit 7d9b258ec087d3a15e28a69279f369e682302678
Author: Toby Cubitt <toby-predictive@dr-qubit.org>
Commit: tsc25 <toby-predictive@dr-qubit.org>

    Improved handling of dictionary file names in dictree-load
---
 dict-tree.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/dict-tree.el b/dict-tree.el
index b2e5a39..3ab34a9 100644
--- a/dict-tree.el
+++ b/dict-tree.el
@@ -2130,9 +2130,12 @@ Returns t if successful, nil otherwise."
 
   ;; sort out dictionary name and file name
   (let (dictname dict)
-    (when (not (string= (substring file -4) ".elc"))
-      (setq file (concat file ".elc")))
-    (setq dictname (substring (file-name-nondirectory file) 0 -4))
+    (cond
+     ((string= (substring file -4) ".elc")
+      (setq dictname (file-name-nondirectory (substring file 0 -4))))
+     ((string= (substring file -3) ".el")
+      (setq dictname (file-name-nondirectory (substring file 0 -3))))
+     (t (setq dictname (file-name-nondirectory file))))
 
     ;; load the dictionary
     (load file t)



reply via email to

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