summaryrefslogtreecommitdiff
path: root/helm-command.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2019-11-14 14:32:32 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2019-11-14 14:32:32 +0100
commit40f8c96158172010c63b486fd54b0a1733f69d2b (patch)
treeb42f8f5e80a2b42fdd59bb054e831441c1039fb1 /helm-command.el
parentaee75f2cfe80c5d075068a644380d6608b0a2156 (diff)
Add PA to history source
* helm-command.el (helm-M-x-persistent-action): New. (helm-M-x-read-extended-command): Use it.
Diffstat (limited to 'helm-command.el')
-rw-r--r--helm-command.el25
1 files changed, 16 insertions, 9 deletions
diff --git a/helm-command.el b/helm-command.el
index 4728055d..c8445dcc 100644
--- a/helm-command.el
+++ b/helm-command.el
@@ -198,7 +198,11 @@ fuzzy matching is running its own sort function with a different algorithm."
(defun helm-M-x-fuzzy-sort-candidates (candidates _source)
(helm-fuzzy-matching-default-sort-fn-1 candidates t))
-(defun helm-M-x-read-extended-command (&optional collection history)
+(defun helm-M-x-persistent-action (candidate)
+ (helm-elisp--persistent-help
+ candidate 'helm-describe-function))
+
+(defun helm-M-x-read-extended-command (collection &optional history)
"Read command name to invoke in `helm-M-x'.
Helm completion is not provided when executing or defining
kbd macros.
@@ -223,18 +227,21 @@ than the default which is OBARRAY."
:candidates (helm-dynamic-completion
(or history extended-command-history)
#'commandp)
+ :persistent-action
+ 'helm-M-x-persistent-action
+ :persistent-help "Describe this command"
:match-dynamic t
- :filtered-candidate-transformer 'helm-M-x-transformer-hist)
+ :filtered-candidate-transformer
+ 'helm-M-x-transformer-hist)
,(helm-build-sync-source "Emacs Commands"
:candidates (helm-dynamic-completion
- (or collection obarray)
- #'commandp)
+ collection #'commandp)
:match-dynamic t
:requires-pattern helm-M-x-requires-pattern
- :filtered-candidate-transformer 'helm-M-x-transformer
- :persistent-action (lambda (candidate)
- (helm-elisp--persistent-help
- candidate 'helm-describe-function))
+ :filtered-candidate-transformer
+ 'helm-M-x-transformer
+ :persistent-action
+ 'helm-M-x-persistent-action
:persistent-help "Describe this command"
:group 'helm-command
:keymap helm-M-x-map))))
@@ -307,7 +314,7 @@ You can get help on each command by persistent action."
(interactive
(progn
(setq helm-M-x-prefix-argument current-prefix-arg)
- (list current-prefix-arg (helm-M-x-read-extended-command))))
+ (list current-prefix-arg (helm-M-x-read-extended-command obarray))))
(when (stringp command-name)
(unless (string= command-name "")
(let ((sym-com (and (stringp command-name) (intern-soft command-name))))