diff options
Diffstat (limited to 'helm-command.el')
-rw-r--r-- | helm-command.el | 35 |
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) |