diff options
| author | Karl Heuer <kwzh@gnu.org> | 1995-07-17 22:47:19 +0000 |
|---|---|---|
| committer | Karl Heuer <kwzh@gnu.org> | 1995-07-17 22:47:19 +0000 |
| commit | e26815c37e16b15af699bd186c1271081c46346c (patch) | |
| tree | 793dae1ebfc3b2bcde3e321a0923ec14ae6bf80d /lisp/mouse.el | |
| parent | 37c29340c75843896e75b6f2742cca6915129c32 (diff) | |
| download | emacs-e26815c37e16b15af699bd186c1271081c46346c.tar.gz | |
(mouse-major-mode-menu): Catch quit in read-key-sequence.
(mouse-major-mode-menu): Don't call command-execute
if lookup-key gives nil.
Diffstat (limited to 'lisp/mouse.el')
| -rw-r--r-- | lisp/mouse.el | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el index 84daf4b4a91..a52d0d14213 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -55,13 +55,19 @@ (and (current-local-map) (lookup-key (current-local-map) [menu-bar]))))) (mouse-major-mode-menu-compute-equiv-keys newmap) - (command-execute - ;; Make NEWMAP override the usual definition - ;; of the mouse button that got us here. - ;; Then read the user's menu choice. - (let ((minor-mode-map-alist - (cons (cons t newmap) minor-mode-map-alist))) - (lookup-key newmap (read-key-sequence "")))))) + ;; Make NEWMAP override the usual definition + ;; of the mouse button that got us here. + ;; Then read the user's menu choice. + (let* ((minor-mode-map-alist + (cons (cons t newmap) minor-mode-map-alist)) + ;; read-key-sequence quits if the user aborts the menu. + ;; If that happens, do nothing silently. + (keyseq (condition-case nil + (read-key-sequence "") + (quit nil))) + (command (if keyseq (lookup-key newmap keyseq)))) + (if command + (command-execute command))))) ;; Compute and cache the equivalent keys in MENU and all its submenus. (defun mouse-major-mode-menu-compute-equiv-keys (menu) |
