diff options
author | Richard M. Stallman <rms@gnu.org> | 1992-12-29 21:06:51 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1992-12-29 21:06:51 +0000 |
commit | d85d6a4c61b3904a379b10675afb0f9b12a41697 (patch) | |
tree | 09a50e391b0525fad61f64138ae85a20f6cbd510 /lisp/mouse.el | |
parent | b2f95f7c983af0970f33428458bdd4c100f7f8ba (diff) | |
download | emacs-d85d6a4c61b3904a379b10675afb0f9b12a41697.tar.gz |
(mouse-buffer-menu): Select the window clicked on.
Diffstat (limited to 'lisp/mouse.el')
-rw-r--r-- | lisp/mouse.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el index 4c1908b220b..810022e6463 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -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. |