diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2016-12-07 13:24:05 +0100 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2016-12-07 13:24:05 +0100 |
commit | 8e1f56be70e81d22258aab58a4211e51f6eefae3 (patch) | |
tree | fc04e1564f74907392ae834acceea3a920c473cc /helm-misc.el | |
parent | 88d59c4df2034d5e2a324d41cf3a4e2ced3c9f6d (diff) |
Prevent calling helm-minibuffer-history on itself.
* helm-misc.el (helm-source-minibuffer-history):
Use helm-minibuffer-history-map and simplify candidates fn.
(helm-minibuffer-history-map): New use it.
Diffstat (limited to 'helm-misc.el')
-rw-r--r-- | helm-misc.el | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/helm-misc.el b/helm-misc.el index e5fa4643..2946bf65 100644 --- a/helm-misc.el +++ b/helm-misc.el @@ -200,13 +200,15 @@ It is added to `extended-command-history'. :header-name (lambda (name) (format "%s (%s)" name minibuffer-history-variable)) :candidates - (lambda () - (let ((history (cl-loop for i in - (symbol-value minibuffer-history-variable) - unless (string= "" i) collect i))) - (if (consp (car history)) - (mapcar 'prin1-to-string history) - history))) + (lambda () + (cl-loop for i in + (symbol-value minibuffer-history-variable) + unless (string= "" i) collect i into history + finally return + (if (consp (car history)) + (mapcar 'prin1-to-string history) + history))) + :keymap helm-minibuffer-history-map :migemo t :multiline t :action (lambda (candidate) @@ -214,6 +216,12 @@ It is added to `extended-command-history'. (delete-minibuffer-contents) (insert candidate))))) +(defvar helm-minibuffer-history-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map helm-map) + (define-key map [remap helm-minibuffer-history] 'undefined) + map)) + ;;; Shell history ;; ;; |