Added separate history support for gadict Emacs mode.
--- a/misc/gadict.el Mon Nov 09 19:49:48 2020 +0200
+++ b/misc/gadict.el Sat Nov 14 14:57:50 2020 +0200
@@ -310,10 +310,15 @@
(throw 'exit nil))
(setq prev curr)) )))
+(defvar gadict--headword-history nil
+ "History for gadict's headwords.")
+(defvar gadict--pos-history nil
+ "History for gadict's POS.")
+
(defun gadict-search (headword)
"Move to HEADWORD definition or place on posiiton for new corresponding
definition. Check for headwords ordering during search."
- (interactive (list (read-string "Headword: ")))
+ (interactive (list (read-string "Headword: " nil 'gadict--headword-history)))
(gadict-search-floor headword)
(recenter))
@@ -321,9 +326,9 @@
"Insert new article template with respect of headword order."
(interactive)
(let (headword pos)
- (setq headword (read-string "Headword: "))
+ (setq headword (read-string "Headword: " nil 'gadict--headword-history))
(unless (gadict-search-floor headword)
- (setq pos (completing-read "POS: " gadict--pos nil t))
+ (setq pos (completing-read "POS: " gadict--pos nil t nil 'gadict--pos-history))
(gadict-insert-article headword pos)
(recenter))))
@@ -338,7 +343,7 @@
(defun gadict-insert-translation (pos)
"Insert translation template using value of `gadict-tr'."
- (interactive (list (completing-read "POS: " gadict--pos nil t)))
+ (interactive (list (completing-read "POS: " gadict--pos nil t nil 'gadict--pos-history)))
(let ( (headword-end (gadict--find-headword-end)) )
(if (< (point) headword-end)
(goto-char headword-end)