It turns out that this change is not needed, and it leaves several
command loops settings not done.
https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00757.html
https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00840.html
;; `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))))