diff options
| author | Matthias Meulien | 2020-11-08 16:08:07 +0100 |
|---|---|---|
| committer | Torsten Hilbrich | 2020-11-19 08:33:42 +0100 |
| commit | 7ca331a4f94a6a5f9c454823fd5c765031ce7167 (patch) | |
| tree | 255e53f550ccf99b53a8d7bf856253deae2e78f4 | |
| parent | 28fe1349711e36bd65542472cd3fb0d94c5e2bb2 (diff) | |
| download | emacs-7ca331a4f94a6a5f9c454823fd5c765031ce7167.tar.gz emacs-7ca331a4f94a6a5f9c454823fd5c765031ce7167.zip | |
Add history of search words to read-string
| -rw-r--r-- | lisp/net/dictionary.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index 0682d5511c9..510a905aca9 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el | |||
| @@ -344,6 +344,10 @@ is utf-8" | |||
| 344 | (error nil)) | 344 | (error nil)) |
| 345 | "Determines if the Emacs has support to display color") | 345 | "Determines if the Emacs has support to display color") |
| 346 | 346 | ||
| 347 | (defvar dictionary-word-history | ||
| 348 | '() | ||
| 349 | "History list of searched word") | ||
| 350 | |||
| 347 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 351 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 348 | ;; Basic function providing startup actions | 352 | ;; Basic function providing startup actions |
| 349 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 353 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| @@ -1118,7 +1122,7 @@ It presents the word at point as default input and allows editing it." | |||
| 1118 | (read-string (if default | 1122 | (read-string (if default |
| 1119 | (format "Search word (%s): " default) | 1123 | (format "Search word (%s): " default) |
| 1120 | "Search word: ") | 1124 | "Search word: ") |
| 1121 | nil nil default)) | 1125 | nil 'dictionary-word-history default)) |
| 1122 | (if current-prefix-arg | 1126 | (if current-prefix-arg |
| 1123 | (read-string (if dictionary-default-dictionary | 1127 | (read-string (if dictionary-default-dictionary |
| 1124 | (format "Dictionary (%s): " dictionary-default-dictionary) | 1128 | (format "Dictionary (%s): " dictionary-default-dictionary) |
| @@ -1128,7 +1132,7 @@ It presents the word at point as default input and allows editing it." | |||
| 1128 | 1132 | ||
| 1129 | ;; if called by pressing the button | 1133 | ;; if called by pressing the button |
| 1130 | (unless word | 1134 | (unless word |
| 1131 | (setq word (read-string "Search word: "))) | 1135 | (setq word (read-string "Search word: " nil 'dictionary-word-history))) |
| 1132 | ;; just in case non-interactivly called | 1136 | ;; just in case non-interactivly called |
| 1133 | (unless dictionary | 1137 | (unless dictionary |
| 1134 | (setq dictionary dictionary-default-dictionary)) | 1138 | (setq dictionary dictionary-default-dictionary)) |
| @@ -1158,7 +1162,8 @@ It presents the word at point as default input and allows editing it." | |||
| 1158 | (interactive) | 1162 | (interactive) |
| 1159 | ;; can't use interactive because of mouse events | 1163 | ;; can't use interactive because of mouse events |
| 1160 | (or pattern | 1164 | (or pattern |
| 1161 | (setq pattern (read-string "Search pattern: "))) | 1165 | (setq pattern (read-string "Search pattern: " |
| 1166 | nil 'dictionary-word-history))) | ||
| 1162 | (dictionary-new-matching pattern)) | 1167 | (dictionary-new-matching pattern)) |
| 1163 | 1168 | ||
| 1164 | ;;;###autoload | 1169 | ;;;###autoload |