diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2015-10-17 08:28:05 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2015-10-17 08:28:05 +0200 |
commit | 9b2adeed03ba4c1af34ab6124b49bb4b906f4ef1 (patch) | |
tree | 5726801a5bc57086ef63a7e18b6a7a37f9cee469 /helm-command.el | |
parent | 4ebb246a874c8927318598d79d20d787a9ac3eca (diff) |
Use same persistent fn for M-x and apropos (#1222).
* helm-elisp.el (helm-elisp--persistent-help): New.
(helm-def-source--emacs-variables): Use it.
(helm-def-source--emacs-commands): Use it.
(helm-def-source--emacs-functions): Use it.
(helm-def-source--eieio-classes): Use it.
(helm-def-source--eieio-generic): Use it.
* helm-command.el (helm-M-x-read-extended-command): Use it.
Diffstat (limited to 'helm-command.el')
-rw-r--r-- | helm-command.el | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/helm-command.el b/helm-command.el index 884c3a07..8dacc4ae 100644 --- a/helm-command.el +++ b/helm-command.el @@ -169,29 +169,11 @@ than the default which is OBARRAY." (read-extended-command)) (helm-mode 1)) (read-extended-command)) - (let* (in-help - help-cand - (orig-fuzzy-sort-fn helm-fuzzy-sort-fn) + (let* ((orig-fuzzy-sort-fn helm-fuzzy-sort-fn) (helm-fuzzy-sort-fn (lambda (candidates source) (funcall orig-fuzzy-sort-fn candidates source 'real))) (helm--mode-line-display-prefarg t) - (pers-help - (lambda (candidate) - (let ((hbuf (get-buffer (help-buffer)))) - (if (and in-help (string= candidate help-cand) - (null helm-persistent-action-use-special-display)) - (progn - ;; When M-x is started from a help buffer, - ;; Don't kill it as it is helm-current-buffer. - (unless (equal hbuf helm-current-buffer) - (kill-buffer hbuf) - (set-window-buffer (get-buffer-window hbuf) - helm-current-buffer)) - (setq in-help nil)) - (helm-describe-function candidate) - (setq in-help t)) - (setq help-cand candidate)))) (tm (run-at-time 1 0.1 'helm-M-x--notify-prefix-arg)) (helm-move-selection-after-hook (cons (lambda () (setq current-prefix-arg nil)) @@ -216,7 +198,9 @@ than the default which is OBARRAY." :requires-pattern helm-M-x-requires-pattern :name "Emacs Commands" :buffer "*helm M-x*" - :persistent-action pers-help + :persistent-action (lambda (candidate) + (helm-elisp--persistent-help + candidate 'helm-describe-function)) :persistent-help "Describe this command" :history (or history extended-command-history) :reverse-history helm-M-x-reverse-history |