emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master a2ee819: Let delete-selection-mode work with popup-


From: Noam Postavsky
Subject: [Emacs-diffs] master a2ee819: Let delete-selection-mode work with popup-menu commands (Bug#27569)
Date: Tue, 18 Jul 2017 06:39:51 -0400 (EDT)

branch: master
commit a2ee81911bdf0f37b992989a9d36bb4d2ba14052
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Let delete-selection-mode work with popup-menu commands (Bug#27569)
    
    * lisp/menu-bar.el (popup-menu): Run `pre-command-hook' with
    `this-command' set to the selected command.
---
 lisp/menu-bar.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 3ca7d1b..4a56978 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -2375,6 +2375,10 @@ FROM-MENU-BAR, if non-nil, means we are dropping one of 
menu-bar's menus."
       ;; `setup-specified-language-environment', for instance,
       ;; expects this to be set from a menu keymap.
       (setq last-command-event (car (last event)))
+      ;; Update `this-command' and run `pre-command-hook' so that
+      ;; things like `delete-selection-pre-hook' will work correctly.
+      (setq this-command cmd)
+      (run-hooks 'pre-command-hook)
       ;; mouse-major-mode-menu was using `command-execute' instead.
       (call-interactively cmd))))
 



reply via email to

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