summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1993-07-01 03:31:58 +0000
committerRoland McGrath <roland@gnu.org>1993-07-01 03:31:58 +0000
commitdfabc98f78931173f02da28b7449a93dd205c8e8 (patch)
tree05adf38d2c8371eb74ae4e3a0984fa97c1117f36
parentac2a7a9197e98909c978d1ffe4d044326bd74135 (diff)
downloademacs-dfabc98f78931173f02da28b7449a93dd205c8e8.tar.gz
(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.el21
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."
0 yank-menu-length)))
(prog1 (cons string count)
(setq count (1+ count))))
- kill-ring)))
- (rotate-yank-pointer (x-popup-menu event
- (list "Yank Menu"
- (cons "Pick Selection" menu))))
- (if (interactive-p)
- (message "The next yank will insert the selected text.")
- (current-kill 0))))
+ kill-ring))
+ (arg (x-popup-menu event
+ (list "Yank Menu"
+ (cons "Pick Selection" menu)))))
+ ;; A mouse click outside the menu returns nil.
+ ;; Avoid a confusing error from passing nil to rotate-yank-pointer.
+ ;; XXX should this perhaps do something other than simply return? -rm
+ (if arg
+ (progn
+ (rotate-yank-pointer arg)
+ (if (interactive-p)
+ (message "The next yank will insert the selected text.")
+ (current-kill 0))))))
+(put 'mouse-menu-choose-yank 'menu-enable 'kill-ring)
(define-key menu-bar-edit-menu [choose-selection]
'("Choose Pasting Selection" . mouse-menu-choose-yank))