emacs-diffs
[Top][All Lists]
Advanced

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

feature/integration-of-dictionary-el 7ca331a 2/2: Add history of search


From: Torsten Hilbrich
Subject: feature/integration-of-dictionary-el 7ca331a 2/2: Add history of search words to read-string
Date: Thu, 19 Nov 2020 02:35:40 -0500 (EST)

branch: feature/integration-of-dictionary-el
commit 7ca331a4f94a6a5f9c454823fd5c765031ce7167
Author: Matthias Meulien <orontee@gmail.com>
Commit: Torsten Hilbrich <torsten.hilbrich@gmx.net>

    Add history of search words to read-string
---
 lisp/net/dictionary.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 0682d55..510a905 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -344,6 +344,10 @@ is utf-8"
     (error nil))
   "Determines if the Emacs has support to display color")
 
+(defvar dictionary-word-history
+  '()
+  "History list of searched word")
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Basic function providing startup actions
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1118,7 +1122,7 @@ It presents the word at point as default input and allows 
editing it."
            (read-string (if default
                             (format "Search word (%s): " default)
                           "Search word: ")
-                        nil nil default))
+                        nil 'dictionary-word-history default))
         (if current-prefix-arg
             (read-string (if dictionary-default-dictionary
                              (format "Dictionary (%s): " 
dictionary-default-dictionary)
@@ -1128,7 +1132,7 @@ It presents the word at point as default input and allows 
editing it."
 
   ;; if called by pressing the button
   (unless word
-    (setq word (read-string "Search word: ")))
+    (setq word (read-string "Search word: " nil 'dictionary-word-history)))
   ;; just in case non-interactivly called
   (unless dictionary
     (setq dictionary dictionary-default-dictionary))
@@ -1158,7 +1162,8 @@ It presents the word at point as default input and allows 
editing it."
   (interactive)
   ;; can't use interactive because of mouse events
   (or pattern
-      (setq pattern (read-string "Search pattern: ")))
+      (setq pattern (read-string "Search pattern: "
+                                 nil 'dictionary-word-history)))
   (dictionary-new-matching pattern))
 
 ;;;###autoload



reply via email to

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