Mercurial > emacs
comparison lisp/buff-menu.el @ 6609:3b1eb7f1eba1
(Buffer-menu-mouse-select): New command.
(Buffer-menu-mode-map): Bind mouse-2.
(Buffer-menu-mode): Doc fix.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 31 Mar 1994 16:46:57 +0000 |
parents | d42c85701055 |
children | 61e40a447c92 |
comparison
equal
deleted
inserted
replaced
6608:e631a154dc3b | 6609:3b1eb7f1eba1 |
---|---|
75 (define-key Buffer-menu-mode-map "?" 'describe-mode) | 75 (define-key Buffer-menu-mode-map "?" 'describe-mode) |
76 (define-key Buffer-menu-mode-map "u" 'Buffer-menu-unmark) | 76 (define-key Buffer-menu-mode-map "u" 'Buffer-menu-unmark) |
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. |
83 (put 'Buffer-menu-mode 'mode-class 'special) | 84 (put 'Buffer-menu-mode 'mode-class 'special) |
84 | 85 |
85 (defun Buffer-menu-mode () | 86 (defun Buffer-menu-mode () |
86 "Major mode for editing a list of buffers. | 87 "Major mode for editing a list of buffers. |
87 Each line describes one of the buffers in Emacs. | 88 Each line describes one of the buffers in Emacs. |
88 Letters do not insert themselves; instead, they are commands. | 89 Letters 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. |
103 \\[Buffer-menu-delete] -- mark that buffer to be deleted, and move down. | 105 \\[Buffer-menu-delete] -- mark that buffer to be deleted, and move down. |
104 \\[Buffer-menu-delete-backwards] -- mark that buffer to be deleted, and move up. | 106 \\[Buffer-menu-delete-backwards] -- mark that buffer to be deleted, and move up. |
329 (interactive) | 331 (interactive) |
330 (switch-to-buffer (Buffer-menu-buffer t)) | 332 (switch-to-buffer (Buffer-menu-buffer t)) |
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) |
337 (switch-to-buffer (Buffer-menu-buffer t))) | 351 (switch-to-buffer (Buffer-menu-buffer t))) |
338 | 352 |