summaryrefslogtreecommitdiff
path: root/helm-command.el
diff options
context:
space:
mode:
authorChunyang Xu <xuchunyang.me@gmail.com>2016-06-23 15:10:33 +0800
committerChunyang Xu <xuchunyang.me@gmail.com>2016-06-23 15:12:21 +0800
commit4454d066782a6fe731aa868ad365e419ccb5fb6f (patch)
treea53e392d8e3178494b56fc88c272f3cafbea58f6 /helm-command.el
parent7f581e39b8284e57ed43d96cf5e8a2a9202cca4a (diff)
Use helm-M-x's first arg if calling from lisp or kmacro
Diffstat (limited to 'helm-command.el')
-rw-r--r--helm-command.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/helm-command.el b/helm-command.el
index e135a5f0..0bcfa999 100644
--- a/helm-command.el
+++ b/helm-command.el
@@ -267,9 +267,12 @@ You can get help on each command by persistent action."
;; use the value of arg otherwise use helm-current-prefix-arg.
(let ((prefix-arg
(or helm-current-prefix-arg
- (prog1 helm-M-x-prefix-argument
- (setq helm-M-x-prefix-argument nil arg nil))
- arg)))
+ (when helm-M-x-prefix-argument
+ (prog1 helm-M-x-prefix-argument
+ (setq helm-M-x-prefix-argument nil)))
+ ;; Use arg if calling from lisp or keyboard macro
+ (unless (called-interactively-p 'interactive)
+ arg))))
;; This ugly construct is to save history even on error.
(unless helm-M-x-always-save-history
(command-execute sym-com 'record))