branch: externals/dict-tree commit 7d9b258ec087d3a15e28a69279f369e682302678 Author: Toby Cubitt <toby-predict...@dr-qubit.org> Commit: tsc25 <toby-predict...@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)