emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master dbeb5b1 303/348: Ensure counsel-M-x preserves last-command


From: Oleh Krehel
Subject: [elpa] master dbeb5b1 303/348: Ensure counsel-M-x preserves last-command
Date: Sat, 8 Apr 2017 11:04:19 -0400 (EDT)

branch: master
commit dbeb5b1c7f883ce75da39b56d0fdb18074a6dbbc
Author: Wilfred Hughes <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Ensure counsel-M-x preserves last-command
    
    Fixes #891.
    Fixes #893.
---
 counsel.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/counsel.el b/counsel.el
index adc46d8..d7bc5bc 100644
--- a/counsel.el
+++ b/counsel.el
@@ -699,6 +699,12 @@ Optional INITIAL-INPUT is the initial input in the 
minibuffer."
       (setq cands smex-ido-cache)
       (setq pred nil)
       (setq sort nil))
+    ;; When `counsel-M-x' returns, `last-command' would be set to
+    ;; `counsel-M-x' because :action hasn't been invoked yet.
+    ;; Instead, preserve the old value of `this-command'.
+    (setq this-command last-command)
+    (setq real-this-command real-last-command)
+
     (ivy-read (counsel--M-x-prompt) cands
               :predicate pred
               :require-match t



reply via email to

[Prev in Thread] Current Thread [Next in Thread]