1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-24 07:20:37 +00:00

(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.

Add menu-enable property to this function.
This commit is contained in:
Roland McGrath 1993-07-01 03:31:58 +00:00
parent ac2a7a9197
commit dfabc98f78

View File

@ -121,13 +121,20 @@ A subsequent \\[yank] yanks the choice just selected."
0 yank-menu-length))) 0 yank-menu-length)))
(prog1 (cons string count) (prog1 (cons string count)
(setq count (1+ count)))) (setq count (1+ count))))
kill-ring))) kill-ring))
(rotate-yank-pointer (x-popup-menu event (arg (x-popup-menu event
(list "Yank Menu" (list "Yank Menu"
(cons "Pick Selection" menu)))) (cons "Pick Selection" menu)))))
(if (interactive-p) ;; A mouse click outside the menu returns nil.
(message "The next yank will insert the selected text.") ;; Avoid a confusing error from passing nil to rotate-yank-pointer.
(current-kill 0)))) ;; 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] (define-key menu-bar-edit-menu [choose-selection]
'("Choose Pasting Selection" . mouse-menu-choose-yank)) '("Choose Pasting Selection" . mouse-menu-choose-yank))