# HG changeset patch # User Roland McGrath # Date 741497518 0 # Node ID 877f540d9717040a5b0b68ab77770a16d06d5f0c # Parent 93a7a7b9703023cf93678218c7f8625d2d3846e6 (mouse-menu-choose-yank): Just return when x-popup-menu returns nil. Add menu-enable property to this function. diff -r 93a7a7b97030 -r 877f540d9717 lisp/menu-bar.el --- a/lisp/menu-bar.el Wed Jun 30 22:37:30 1993 +0000 +++ b/lisp/menu-bar.el Thu Jul 01 03:31:58 1993 +0000 @@ -121,13 +121,20 @@ 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))