summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-11-29 15:10:48 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-11-29 15:10:48 +0100
commitfada34bb972817347110df3d80d3d2cf6ade89c3 (patch)
treeb195d724d4a88898b67d038317c9d73a8615c247
parentee7ead62aa6b35675e663ecac4d9275409c9f6c7 (diff)
parent45c45027138624eb586d7ccca06226e333dd8c5a (diff)
downloadorg-mode-fada34bb972817347110df3d80d3d2cf6ade89c3.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org-capture.el17
1 files changed, 15 insertions, 2 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 2222bf4..0321021 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -79,6 +79,12 @@
(defvar org-capture-is-refiling nil
"Non-nil when capture process is refiling an entry.")
+(defvar org-capture--prompt-history-table (make-hash-table :test #'equal)
+ "Hash table for all history lists per prompt.")
+
+(defvar org-capture--prompt-history nil
+ "History list for prompt placeholders.")
+
(defgroup org-capture nil
"Options concerning capturing new entries."
:tag "Org Capture"
@@ -1797,13 +1803,20 @@ The template may still contain \"%?\" for cursor positioning."
(member key '("u" "U"))
nil nil (list org-end-time-was-given))))
(`nil
+ ;; Load history list for current prompt.
+ (setq org-capture--prompt-history
+ (gethash prompt org-capture--prompt-history-table))
(push (org-completing-read
(concat (or prompt "Enter string")
(and default (format " [%s]" default))
": ")
- completions nil nil nil nil default)
+ completions
+ nil nil nil 'org-capture--prompt-history default)
strings)
- (insert (car strings)))
+ (insert (car strings))
+ ;; Save updated history list for current prompt.
+ (puthash prompt org-capture--prompt-history
+ org-capture--prompt-history-table))
(_
(error "Unknown template placeholder: \"%%^%s\""
key))))))))