aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-03-31 16:46:57 +0000
committerRichard M. Stallman1994-03-31 16:46:57 +0000
commit2cf5fc7e0f03591e5fcae8d28ab037b599c80ad2 (patch)
treefe08c8469f238fbdf64543256791cae6ac8866cd
parent121e2227f1b84d2112220bf0d9f7ad68a41f5823 (diff)
downloademacs-2cf5fc7e0f03591e5fcae8d28ab037b599c80ad2.tar.gz
emacs-2cf5fc7e0f03591e5fcae8d28ab037b599c80ad2.zip
(Buffer-menu-mouse-select): New command.
(Buffer-menu-mode-map): Bind mouse-2. (Buffer-menu-mode): Doc fix.
-rw-r--r--lisp/buff-menu.el28
1 files changed, 21 insertions, 7 deletions
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index a0b45bf64b9..e830012cb56 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -77,6 +77,7 @@
77 (define-key Buffer-menu-mode-map "m" 'Buffer-menu-mark) 77 (define-key Buffer-menu-mode-map "m" 'Buffer-menu-mark)
78 (define-key Buffer-menu-mode-map "t" 'Buffer-menu-visit-tags-table) 78 (define-key Buffer-menu-mode-map "t" 'Buffer-menu-visit-tags-table)
79 (define-key Buffer-menu-mode-map "%" 'Buffer-menu-toggle-read-only) 79 (define-key Buffer-menu-mode-map "%" 'Buffer-menu-toggle-read-only)
80 (define-key Buffer-menu-mode-map [mouse-2] 'Buffer-menu-mouse-select)
80) 81)
81 82
82;; Buffer Menu mode is suitable only for specially formatted data. 83;; Buffer Menu mode is suitable only for specially formatted data.
@@ -87,16 +88,17 @@
87Each line describes one of the buffers in Emacs. 88Each line describes one of the buffers in Emacs.
88Letters do not insert themselves; instead, they are commands. 89Letters do not insert themselves; instead, they are commands.
89\\<Buffer-menu-mode-map> 90\\<Buffer-menu-mode-map>
90\\[Buffer-menu-mark] -- mark buffer to be displayed. 91\\[Buffer-menu-mouse-select] -- select buffer you click on, in place of the buffer menu.
91\\[Buffer-menu-select] -- select buffer of line point is on. 92\\[Buffer-menu-this-window] -- select current line's buffer in place of the buffer menu.
92 Also show buffers marked with m in other windows. 93\\[Buffer-menu-other-window] -- select that buffer in another window,
94 so the buffer menu buffer remains visible in its window.
95\\[Buffer-menu-switch-other-window] -- make another window display that buffer.
96\\[Buffer-menu-mark] -- mark current line's buffer to be displayed.
97\\[Buffer-menu-select] -- select current line's buffer.
98 Also show buffers marked with m, in other windows.
93\\[Buffer-menu-1-window] -- select that buffer in full-frame window. 99\\[Buffer-menu-1-window] -- select that buffer in full-frame window.
94\\[Buffer-menu-2-window] -- select that buffer in one window, 100\\[Buffer-menu-2-window] -- select that buffer in one window,
95 together with buffer selected before this one in another window. 101 together with buffer selected before this one in another window.
96\\[Buffer-menu-this-window] -- select that buffer in place of the buffer menu buffer.
97\\[Buffer-menu-other-window] -- select that buffer in another window,
98 so the buffer menu buffer remains visible in its window.
99\\[Buffer-menu-switch-other-window] -- switch the other window to this buffer.
100\\[Buffer-menu-visit-tags-table] -- visit-tags-table this buffer. 102\\[Buffer-menu-visit-tags-table] -- visit-tags-table this buffer.
101\\[Buffer-menu-not-modified] -- clear modified-flag on that buffer. 103\\[Buffer-menu-not-modified] -- clear modified-flag on that buffer.
102\\[Buffer-menu-save] -- mark that buffer to be saved, and move down. 104\\[Buffer-menu-save] -- mark that buffer to be saved, and move down.
@@ -331,6 +333,18 @@ You can mark buffers with the \\<Buffer-menu-mode-map>\\[Buffer-menu-mark] comma
331 (bury-buffer (other-buffer)) 333 (bury-buffer (other-buffer))
332 (delete-other-windows)) 334 (delete-other-windows))
333 335
336(defun Buffer-menu-mouse-select (event)
337 "Select the buffer whose line you click on."
338 (interactive "e")
339 (let (buffer)
340 (save-excursion
341 (set-buffer (window-buffer (posn-window (event-end event))))
342 (save-excursion
343 (goto-char (posn-point (event-end event)))
344 (setq buffer (Buffer-menu-buffer t))))
345 (select-window (posn-window (event-end event)))
346 (switch-to-buffer buffer)))
347
334(defun Buffer-menu-this-window () 348(defun Buffer-menu-this-window ()
335 "Select this line's buffer in this window." 349 "Select this line's buffer in this window."
336 (interactive) 350 (interactive)