diff options
author | Chunyang Xu <xuchunyang.me@gmail.com> | 2016-06-22 18:03:24 +0800 |
---|---|---|
committer | Chunyang Xu <xuchunyang.me@gmail.com> | 2016-06-22 18:04:06 +0800 |
commit | ec277572ac1ca2276632b68dab20462ceaf5866a (patch) | |
tree | a56288fff0ab5cf2de2056fc73bc1145160c19e6 /helm-command.el | |
parent | b90ba57a7c69c9e9e100fea468a7603f0f5f44be (diff) |
Display prefix arg before helm-M-x in prompt
The code is adapted from Emacs's built M-x
Diffstat (limited to 'helm-command.el')
-rw-r--r-- | helm-command.el | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/helm-command.el b/helm-command.el index fecbf11b..7b3dfe8b 100644 --- a/helm-command.el +++ b/helm-command.el @@ -204,7 +204,19 @@ than the default which is OBARRAY." (user-error msg))) (setq current-prefix-arg nil) (helm-comp-read - "M-x " (or collection obarray) + (if helm-M-x-allow-prefix-argument + (concat (cond + ((eq helm-M-x-prefix-argument '-) "- ") + ((and (consp helm-M-x-prefix-argument) + (eq (car helm-M-x-prefix-argument) 4)) "C-u ") + ((and (consp helm-M-x-prefix-argument) + (integerp (car helm-M-x-prefix-argument))) + (format "%d " (car helm-M-x-prefix-argument))) + ((integerp helm-M-x-prefix-argument) + (format "%d " helm-M-x-prefix-argument))) + "M-x ") + "M-x ") + (or collection obarray) :test 'commandp :requires-pattern helm-M-x-requires-pattern :name "Emacs Commands" |