changeset 1728:2a49d509b30d

(mouse-buffer-menu): Select the window clicked on.
author Richard M. Stallman <rms@gnu.org>
date Tue, 29 Dec 1992 21:06:51 +0000
parents d6cc12c97a59
children 5c3898c5aa2d
files lisp/mouse.el
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mouse.el	Tue Dec 29 01:07:26 1992 +0000
+++ b/lisp/mouse.el	Tue Dec 29 21:06:51 1992 +0000
@@ -191,7 +191,9 @@
     (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 @@
 					   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.