summaryrefslogtreecommitdiff
path: root/helm-command.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2017-02-09 14:13:16 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2017-02-09 14:13:16 +0100
commitabb5bf4a0d7588d3488a93528fbd6325775ac083 (patch)
tree21bf3787a7242645de0fa782050b37e179c3621e /helm-command.el
parent41fc00a15a412b56bd9c858e2efdb1686f218329 (diff)
Fail silently when user exit M-x with empty string.
* helm-command.el (helm-M-x): Do it.
Diffstat (limited to 'helm-command.el')
-rw-r--r--helm-command.el35
1 files changed, 18 insertions, 17 deletions
diff --git a/helm-command.el b/helm-command.el
index 203c0890..5773e8ce 100644
--- a/helm-command.el
+++ b/helm-command.el
@@ -264,23 +264,24 @@ 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))))
- (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)))
- ;; This ugly construct is to save history even on error.
- (unless helm-M-x-always-save-history
- (command-execute sym-com 'record))
- (setq extended-command-history
- (cons command-name
- (delete command-name extended-command-history)))
- (when helm-M-x-always-save-history
- (command-execute sym-com 'record))))))
+ (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)))
+ ;; This ugly construct is to save history even on error.
+ (unless helm-M-x-always-save-history
+ (command-execute sym-com 'record))
+ (setq extended-command-history
+ (cons command-name
+ (delete command-name extended-command-history)))
+ (when helm-M-x-always-save-history
+ (command-execute sym-com 'record)))))))
(put 'helm-M-x 'interactive-only 'command-execute)
(provide 'helm-command)