diff options
| author | Roland McGrath | 1993-07-01 03:31:58 +0000 |
|---|---|---|
| committer | Roland McGrath | 1993-07-01 03:31:58 +0000 |
| commit | dfabc98f78931173f02da28b7449a93dd205c8e8 (patch) | |
| tree | 05adf38d2c8371eb74ae4e3a0984fa97c1117f36 | |
| parent | ac2a7a9197e98909c978d1ffe4d044326bd74135 (diff) | |
| download | emacs-dfabc98f78931173f02da28b7449a93dd205c8e8.tar.gz emacs-dfabc98f78931173f02da28b7449a93dd205c8e8.zip | |
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Add menu-enable property to this function.
| -rw-r--r-- | lisp/menu-bar.el | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 67df0d26185..e084157ccb0 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -121,13 +121,20 @@ A subsequent \\[yank] yanks the choice just selected." | |||
| 121 | 0 yank-menu-length))) | 121 | 0 yank-menu-length))) |
| 122 | (prog1 (cons string count) | 122 | (prog1 (cons string count) |
| 123 | (setq count (1+ count)))) | 123 | (setq count (1+ count)))) |
| 124 | kill-ring))) | 124 | kill-ring)) |
| 125 | (rotate-yank-pointer (x-popup-menu event | 125 | (arg (x-popup-menu event |
| 126 | (list "Yank Menu" | 126 | (list "Yank Menu" |
| 127 | (cons "Pick Selection" menu)))) | 127 | (cons "Pick Selection" menu))))) |
| 128 | (if (interactive-p) | 128 | ;; A mouse click outside the menu returns nil. |
| 129 | (message "The next yank will insert the selected text.") | 129 | ;; Avoid a confusing error from passing nil to rotate-yank-pointer. |
| 130 | (current-kill 0)))) | 130 | ;; XXX should this perhaps do something other than simply return? -rm |
| 131 | (if arg | ||
| 132 | (progn | ||
| 133 | (rotate-yank-pointer arg) | ||
| 134 | (if (interactive-p) | ||
| 135 | (message "The next yank will insert the selected text.") | ||
| 136 | (current-kill 0)))))) | ||
| 137 | (put 'mouse-menu-choose-yank 'menu-enable 'kill-ring) | ||
| 131 | 138 | ||
| 132 | (define-key menu-bar-edit-menu [choose-selection] | 139 | (define-key menu-bar-edit-menu [choose-selection] |
| 133 | '("Choose Pasting Selection" . mouse-menu-choose-yank)) | 140 | '("Choose Pasting Selection" . mouse-menu-choose-yank)) |