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.
This commit is contained in:
parent
1a62721f2d
commit
a2ee81911b
1 changed files with 4 additions and 0 deletions
|
|
@ -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))))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue