summaryrefslogtreecommitdiff
path: root/helm-command.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2019-05-27 14:12:22 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2019-05-27 14:53:18 +0200
commitc067c02fe907465c64dc051e1927e6f7d1d7a02b (patch)
treec1026c1179c598a1a62d936c178cdb2fded7420d /helm-command.el
parent614fe6f14f28f75b8933108afc1d71cb8357cf20 (diff)
Fix error in helm-M-x
* helm-command.el (helm-M-x): Ensure command-name is a string.
Diffstat (limited to 'helm-command.el')
-rw-r--r--helm-command.el43
1 files changed, 22 insertions, 21 deletions
diff --git a/helm-command.el b/helm-command.el
index 2bbca9be..54aae483 100644
--- a/helm-command.el
+++ b/helm-command.el
@@ -273,27 +273,28 @@ You can get help on each command by persistent action."
(progn
(setq helm-M-x-prefix-argument current-prefix-arg)
(list current-prefix-arg (helm-M-x-read-extended-command))))
- (unless (string= command-name "")
- (let ((sym-com (and (stringp command-name) (intern-soft command-name))))
- (when sym-com
- ;; Avoid having `this-command' set to *exit-minibuffer.
- (setq this-command sym-com
- ;; Handle C-x z (repeat) Issue #322
- real-this-command sym-com)
- ;; If helm-M-x is called with regular emacs completion (kmacro)
- ;; use the value of arg otherwise use helm-current-prefix-arg.
- (let ((prefix-arg (or helm-current-prefix-arg helm-M-x-prefix-argument)))
- (cl-flet ((save-hist (command)
- (setq extended-command-history
- (cons command (delete command extended-command-history)))))
- (condition-case-unless-debug err
- (progn
- (command-execute sym-com 'record)
- (save-hist command-name))
- (error
- (when helm-M-x-always-save-history
- (save-hist command-name))
- (signal (car err) (cdr err))))))))))
+ (when (stringp command-name)
+ (unless (string= command-name "")
+ (let ((sym-com (and (stringp command-name) (intern-soft command-name))))
+ (when sym-com
+ ;; Avoid having `this-command' set to *exit-minibuffer.
+ (setq this-command sym-com
+ ;; Handle C-x z (repeat) Issue #322
+ real-this-command sym-com)
+ ;; If helm-M-x is called with regular emacs completion (kmacro)
+ ;; use the value of arg otherwise use helm-current-prefix-arg.
+ (let ((prefix-arg (or helm-current-prefix-arg helm-M-x-prefix-argument)))
+ (cl-flet ((save-hist (command)
+ (setq extended-command-history
+ (cons command (delete command extended-command-history)))))
+ (condition-case-unless-debug err
+ (progn
+ (command-execute sym-com 'record)
+ (save-hist command-name))
+ (error
+ (when helm-M-x-always-save-history
+ (save-hist command-name))
+ (signal (car err) (cdr err)))))))))))
(put 'helm-M-x 'interactive-only 'command-execute)
(provide 'helm-command)