1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

(mouse-buffer-menu): Select the window clicked on.

This commit is contained in:
Richard M. Stallman 1992-12-29 21:06:51 +00:00
parent 82f4acafc5
commit 2d82f7b90d

View file

@ -191,7 +191,9 @@ This does not delete the region; it acts like \\[kill-ring-save]."
(call-interactively 'kill-ring-save)))
(defun mouse-buffer-menu (event)
"Pop up a menu of buffers for selection with the mouse."
"Pop up a menu of buffers for selection with the mouse.
This switches buffers in the window that you clicked on,
and selects that window."
(interactive "e")
(let ((menu
(list "Buffer Menu"
@ -212,7 +214,12 @@ This does not delete the region; it acts like \\[kill-ring-save]."
head))))
(setq tail (cdr tail)))
(reverse head))))))
(switch-to-buffer (or (x-popup-menu event menu) (current-buffer)))))
(let ((buf (x-popup-menu event menu))
(window (posn-window (event-start event))))
(if buf
(progn
(select-window window)
(switch-to-buffer buf))))))
;; Commands for the scroll bar.