diff options
| author | Richard M. Stallman | 1993-05-10 16:31:21 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-05-10 16:31:21 +0000 |
| commit | 3ed788ec2c7c30515738ea1cf9c89cd459e2e858 (patch) | |
| tree | b7b18da0faf022d8e04d3de8ccc438cfe0ad9f3c | |
| parent | 0dea0bbe3441a352db75e559c44ebb3ce91fca52 (diff) | |
| download | emacs-3ed788ec2c7c30515738ea1cf9c89cd459e2e858.tar.gz emacs-3ed788ec2c7c30515738ea1cf9c89cd459e2e858.zip | |
(buffer-menu): Don't save a window config.
(Buffer-menu-select): Don't call Buffer-menu-execute.
Don't restore a window config.
| -rw-r--r-- | lisp/buff-menu.el | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index 2d36038da35..eb4c8386c3f 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el | |||
| @@ -32,13 +32,6 @@ | |||
| 32 | 32 | ||
| 33 | ;; Merged by esr with recent mods to Emacs 19 buff-menu, 23 Mar 1993 | 33 | ;; Merged by esr with recent mods to Emacs 19 buff-menu, 23 Mar 1993 |
| 34 | ;; | 34 | ;; |
| 35 | ;; Modified by Bob Weiner, Motorola, Inc., 3/1/89 | ||
| 36 | ;; | ||
| 37 | ;; Save window configuration when 'buffer-menu' is called so that | ||
| 38 | ;; previous window configuration is restored. prior to selecting | ||
| 39 | ;; buffers. | ||
| 40 | ;; Made 'Buffer-menu-select' also perform a 'Buffer-menu-execute'. | ||
| 41 | ;; | ||
| 42 | ;; Modified by Bob Weiner, Motorola, Inc., 4/14/89 | 35 | ;; Modified by Bob Weiner, Motorola, Inc., 4/14/89 |
| 43 | ;; | 36 | ;; |
| 44 | ;; Added optional backup argument to 'Buffer-menu-unmark' to make it undelete | 37 | ;; Added optional backup argument to 'Buffer-menu-unmark' to make it undelete |
| @@ -48,9 +41,9 @@ | |||
| 48 | 41 | ||
| 49 | ;;; Code: | 42 | ;;; Code: |
| 50 | 43 | ||
| 51 | (defvar *buff-window-config* nil | 44 | ;;;Not needed, now that q is now just quit and Buffer-menu-select is v. |
| 52 | "Stores window configuration upon entry of 'buffer-menu'. Used to | 45 | ;;;(defvar Buffer-menu-window-config nil |
| 53 | restore window configuration when only one buffer is selected.") | 46 | ;;; "Window configuration saved from entry to `buffer-menu'.") |
| 54 | 47 | ||
| 55 | ; Put buffer *Buffer List* into proper mode right away | 48 | ; Put buffer *Buffer List* into proper mode right away |
| 56 | ; so that from now on even list-buffers is enough to get a buffer menu. | 49 | ; so that from now on even list-buffers is enough to get a buffer menu. |
| @@ -61,7 +54,8 @@ restore window configuration when only one buffer is selected.") | |||
| 61 | () | 54 | () |
| 62 | (setq Buffer-menu-mode-map (make-keymap)) | 55 | (setq Buffer-menu-mode-map (make-keymap)) |
| 63 | (suppress-keymap Buffer-menu-mode-map t) | 56 | (suppress-keymap Buffer-menu-mode-map t) |
| 64 | (define-key Buffer-menu-mode-map "q" 'Buffer-menu-select) | 57 | (define-key Buffer-menu-mode-map "q" 'Buffer-menu-quit) |
| 58 | (define-key Buffer-menu-mode-map "v" 'Buffer-menu-select) | ||
| 65 | (define-key Buffer-menu-mode-map "2" 'Buffer-menu-2-window) | 59 | (define-key Buffer-menu-mode-map "2" 'Buffer-menu-2-window) |
| 66 | (define-key Buffer-menu-mode-map "1" 'Buffer-menu-1-window) | 60 | (define-key Buffer-menu-mode-map "1" 'Buffer-menu-1-window) |
| 67 | (define-key Buffer-menu-mode-map "f" 'Buffer-menu-this-window) | 61 | (define-key Buffer-menu-mode-map "f" 'Buffer-menu-this-window) |
| @@ -157,12 +151,21 @@ Type ? after invocation to get help on commands available. | |||
| 157 | Type q immediately to make the buffer menu go away and to restore | 151 | Type q immediately to make the buffer menu go away and to restore |
| 158 | previous window configuration." | 152 | previous window configuration." |
| 159 | (interactive "P") | 153 | (interactive "P") |
| 160 | (setq *buff-window-config* (current-window-configuration)) | 154 | ;;; (setq Buffer-menu-window-config (current-window-configuration)) |
| 161 | (list-buffers arg) | 155 | (list-buffers arg) |
| 162 | (pop-to-buffer "*Buffer List*") | 156 | (pop-to-buffer "*Buffer List*") |
| 163 | (forward-line 2) | 157 | (forward-line 2) |
| 164 | (message | 158 | (message |
| 165 | "Commands: d, s, x; 1, 2, m, u; delete; ~; q to quit; ? for help.")) | 159 | "Commands: d, s, x, u; f, o, 1, 2, m, v; ~, %%; q to quit; ? for help.")) |
| 160 | |||
| 161 | (defun Buffer-menu-quit () | ||
| 162 | "Quit the buffer menu." | ||
| 163 | (interactive) | ||
| 164 | (let ((buffer (current-buffer))) | ||
| 165 | ;; Restore previous window configuration before displaying | ||
| 166 | ;; selected buffers. | ||
| 167 | (switch-to-buffer (other-buffer)) | ||
| 168 | (bury-buffer buffer))) | ||
| 166 | 169 | ||
| 167 | (defun Buffer-menu-mark () | 170 | (defun Buffer-menu-mark () |
| 168 | "Mark buffer on this line for being displayed by \\<Buffer-menu-mode-map>\\[Buffer-menu-select] command." | 171 | "Mark buffer on this line for being displayed by \\<Buffer-menu-mode-map>\\[Buffer-menu-select] command." |
| @@ -291,19 +294,18 @@ You can mark buffers with the \\<Buffer-menu-mode-map>\\[Buffer-menu-mark] comma | |||
| 291 | (or (eq tem buff) (memq tem others) (setq others (cons tem others)))) | 294 | (or (eq tem buff) (memq tem others) (setq others (cons tem others)))) |
| 292 | (setq others (nreverse others) | 295 | (setq others (nreverse others) |
| 293 | tem (/ (1- (frame-height)) (1+ (length others)))) | 296 | tem (/ (1- (frame-height)) (1+ (length others)))) |
| 294 | (Buffer-menu-execute) | ||
| 295 | (delete-other-windows) | 297 | (delete-other-windows) |
| 296 | (switch-to-buffer buff) | 298 | (switch-to-buffer buff) |
| 297 | (or (eq menu buff) | 299 | (or (eq menu buff) |
| 298 | (bury-buffer menu)) | 300 | (bury-buffer menu)) |
| 299 | (if (equal (length others) 0) | 301 | (if (equal (length others) 0) |
| 300 | (progn | 302 | (progn |
| 301 | ;; Restore previous window configuration before displaying | 303 | ;;; ;; Restore previous window configuration before displaying |
| 302 | ;; selected buffers. | 304 | ;;; ;; selected buffers. |
| 303 | (if *buff-window-config* | 305 | ;;; (if Buffer-menu-window-config |
| 304 | (progn | 306 | ;;; (progn |
| 305 | (set-window-configuration *buff-window-config*) | 307 | ;;; (set-window-configuration Buffer-menu-window-config) |
| 306 | (setq *buff-window-config* nil))) | 308 | ;;; (setq Buffer-menu-window-config nil))) |
| 307 | (switch-to-buffer buff)) | 309 | (switch-to-buffer buff)) |
| 308 | (while others | 310 | (while others |
| 309 | (split-window nil tem) | 311 | (split-window nil tem) |