diff options
| author | Richard M. Stallman | 1992-12-29 21:06:51 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1992-12-29 21:06:51 +0000 |
| commit | 2d82f7b90d23b230f5b52e2a6e50baec31ac4e49 (patch) | |
| tree | dd833f8c4a0c9090f0285a2ab540f4cc43a34457 | |
| parent | 82f4acafc5a7ca59e5c06696194fe16f39536f27 (diff) | |
| download | emacs-2d82f7b90d23b230f5b52e2a6e50baec31ac4e49.tar.gz emacs-2d82f7b90d23b230f5b52e2a6e50baec31ac4e49.zip | |
(mouse-buffer-menu): Select the window clicked on.
| -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]." | |||
| 191 | (call-interactively 'kill-ring-save))) | 191 | (call-interactively 'kill-ring-save))) |
| 192 | 192 | ||
| 193 | (defun mouse-buffer-menu (event) | 193 | (defun mouse-buffer-menu (event) |
| 194 | "Pop up a menu of buffers for selection with the mouse." | 194 | "Pop up a menu of buffers for selection with the mouse. |
| 195 | This switches buffers in the window that you clicked on, | ||
| 196 | and selects that window." | ||
| 195 | (interactive "e") | 197 | (interactive "e") |
| 196 | (let ((menu | 198 | (let ((menu |
| 197 | (list "Buffer Menu" | 199 | (list "Buffer Menu" |
| @@ -212,7 +214,12 @@ This does not delete the region; it acts like \\[kill-ring-save]." | |||
| 212 | head)))) | 214 | head)))) |
| 213 | (setq tail (cdr tail))) | 215 | (setq tail (cdr tail))) |
| 214 | (reverse head)))))) | 216 | (reverse head)))))) |
| 215 | (switch-to-buffer (or (x-popup-menu event menu) (current-buffer))))) | 217 | (let ((buf (x-popup-menu event menu)) |
| 218 | (window (posn-window (event-start event)))) | ||
| 219 | (if buf | ||
| 220 | (progn | ||
| 221 | (select-window window) | ||
| 222 | (switch-to-buffer buf)))))) | ||
| 216 | 223 | ||
| 217 | ;; Commands for the scroll bar. | 224 | ;; Commands for the scroll bar. |
| 218 | 225 | ||