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

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

[elpa] externals/dict-tree 3ecd763 006/154: Added minor miscellaneous ne


From: Stefan Monnier
Subject: [elpa] externals/dict-tree 3ecd763 006/154: Added minor miscellaneous new features, mostly to predictive.el.
Date: Mon, 14 Dec 2020 12:21:33 -0500 (EST)

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

    Added minor miscellaneous new features, mostly to predictive.el.
---
 dict-tree.el | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/dict-tree.el b/dict-tree.el
index 98ffde7..c618632 100644
--- a/dict-tree.el
+++ b/dict-tree.el
@@ -5,7 +5,7 @@
 ;; Copyright (C) 2004-2006 Toby Cubitt
 
 ;; Author: Toby Cubitt <toby-predictive@dr-qubit.org>
-;; Version: 0.10
+;; Version: 0.10.1
 ;; Keywords: dictionary, tree
 ;; URL: http://www.dr-qubit.org/emacs.php
 
@@ -54,6 +54,10 @@
 
 ;;; Change log:
 ;;
+;; Version 0.10.1
+;; * added optional DICTLIST argument to `read-dict', to allow completion from
+;;   a restricted set of dictionaries
+;;
 ;; Version 0.10
 ;; * finally wrote a `dictree-delete' function!
 ;;
@@ -2220,17 +2224,19 @@ giving it the name DICTNAME."
   "History list for commands that read an existing ditionary name.")
 
 
-(defun read-dict (prompt &optional default)
+(defun read-dict (prompt &optional default dictlist)
   "Read the name of a dictionary with completion, and return it.
-Prompt with PROMPT. By default, return DEFAULT."
-  (let (dictlist)
+
+Prompt with PROMPT. By default, return DEFAULT. If DICTLIST is
+supplied, only complete on dictionaries in that list."
+  (let (dictnames)
     (mapc (lambda (dict)
            (unless (or (null (dictree--name dict))
-                       (member (dictree--name dict) dictlist))
-             (push (list (dictree--name dict)) dictlist)))
-         dictree-loaded-list)
+                       (member (dictree--name dict) dictnames))
+             (push (list (dictree--name dict)) dictnames)))
+         (or dictlist dictree-loaded-list))
     (eval (intern-soft
-          (completing-read prompt dictlist
+          (completing-read prompt dictnames
                            nil t nil 'dictree-history default))))
 )
 



reply via email to

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