diff options
| author | Christoph Scholtes | 2014-08-31 14:44:36 -0600 |
|---|---|---|
| committer | Christoph Scholtes | 2014-08-31 14:44:36 -0600 |
| commit | 60aa41b935d93c2f4126056de5263c535530ba5e (patch) | |
| tree | f61132588504cbd32faac706252aca6ac3d8c2cf | |
| parent | 4457cc825bdbe30f704c80edbae25d12e7e5bab2 (diff) | |
| download | emacs-60aa41b935d93c2f4126056de5263c535530ba5e.tar.gz emacs-60aa41b935d93c2f4126056de5263c535530ba5e.zip | |
Replace mode-specific quit function in ibuffer.el
* lisp/ibuffer.el: Replace mode-specific quit function with
`quit-window' via `special-mode'.
(ibuffer-mode-map): Use keybindings from special-mode-map instead
of local overrides.
(ibuffer): Don't store previous windows configuration. Let
`quit-window' handle restoring.
(ibuffer-quit): Remove function. Use `quit-window' instead.
(ibuffer-restore-window-config-on-quit): Remove variable.
(ibuffer-prev-window-config): Remove variable.
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/ibuffer.el | 28 |
2 files changed, 13 insertions, 27 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d1459592777..7087cde6d44 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2014-08-31 Christoph Scholtes <cschol2112@gmail.com> | ||
| 2 | |||
| 3 | * ibuffer.el: Replace mode-specific quit function with | ||
| 4 | `quit-window' via `special-mode'. | ||
| 5 | (ibuffer-mode-map): Use keybindings from special-mode-map instead | ||
| 6 | of local overrides. | ||
| 7 | (ibuffer): Don't store previous windows configuration. Let | ||
| 8 | `quit-window' handle restoring. | ||
| 9 | (ibuffer-quit): Remove function. Use `quit-window' instead. | ||
| 10 | (ibuffer-restore-window-config-on-quit): Remove variable. | ||
| 11 | (ibuffer-prev-window-config): Remove variable. | ||
| 12 | |||
| 1 | 2014-08-29 Michael Heerdegen <michael_heerdegen@web.de> | 13 | 2014-08-29 Michael Heerdegen <michael_heerdegen@web.de> |
| 2 | 14 | ||
| 3 | * emacs-lisp/easy-mmode.el (define-minor-mode): Use mode function | 15 | * emacs-lisp/easy-mmode.el (define-minor-mode): Use mode function |
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 833bce12c8e..0f219e143b2 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el | |||
| @@ -540,10 +540,6 @@ directory, like `default-directory'." | |||
| 540 | (define-key map (kbd "/ X") 'ibuffer-delete-saved-filter-groups) | 540 | (define-key map (kbd "/ X") 'ibuffer-delete-saved-filter-groups) |
| 541 | (define-key map (kbd "/ \\") 'ibuffer-clear-filter-groups) | 541 | (define-key map (kbd "/ \\") 'ibuffer-clear-filter-groups) |
| 542 | 542 | ||
| 543 | (define-key map (kbd "q") 'ibuffer-quit) | ||
| 544 | (define-key map (kbd "h") 'describe-mode) | ||
| 545 | (define-key map (kbd "?") 'describe-mode) | ||
| 546 | |||
| 547 | (define-key map (kbd "% n") 'ibuffer-mark-by-name-regexp) | 543 | (define-key map (kbd "% n") 'ibuffer-mark-by-name-regexp) |
| 548 | (define-key map (kbd "% m") 'ibuffer-mark-by-mode-regexp) | 544 | (define-key map (kbd "% m") 'ibuffer-mark-by-mode-regexp) |
| 549 | (define-key map (kbd "% f") 'ibuffer-mark-by-file-name-regexp) | 545 | (define-key map (kbd "% f") 'ibuffer-mark-by-file-name-regexp) |
| @@ -878,12 +874,6 @@ directory, like `default-directory'." | |||
| 878 | (define-key map [down-mouse-3] 'ibuffer-mouse-popup-menu) | 874 | (define-key map [down-mouse-3] 'ibuffer-mouse-popup-menu) |
| 879 | map)) | 875 | map)) |
| 880 | 876 | ||
| 881 | (defvar ibuffer-restore-window-config-on-quit nil | ||
| 882 | "If non-nil, restore previous window configuration upon exiting `ibuffer'.") | ||
| 883 | |||
| 884 | (defvar ibuffer-prev-window-config nil | ||
| 885 | "Window configuration before starting Ibuffer.") | ||
| 886 | |||
| 887 | (defvar ibuffer-did-modification nil) | 877 | (defvar ibuffer-did-modification nil) |
| 888 | 878 | ||
| 889 | (defvar ibuffer-compiled-formats nil) | 879 | (defvar ibuffer-compiled-formats nil) |
| @@ -2298,18 +2288,6 @@ If optional arg SILENT is non-nil, do not display progress messages." | |||
| 2298 | (goto-char (point-min)) | 2288 | (goto-char (point-min)) |
| 2299 | (forward-line orig)))) | 2289 | (forward-line orig)))) |
| 2300 | 2290 | ||
| 2301 | (defun ibuffer-quit () | ||
| 2302 | "Quit this `ibuffer' session. | ||
| 2303 | Try to restore the previous window configuration if | ||
| 2304 | `ibuffer-restore-window-config-on-quit' is non-nil." | ||
| 2305 | (interactive) | ||
| 2306 | (if ibuffer-restore-window-config-on-quit | ||
| 2307 | (progn | ||
| 2308 | (bury-buffer) | ||
| 2309 | (unless (= (count-windows) 1) | ||
| 2310 | (set-window-configuration ibuffer-prev-window-config))) | ||
| 2311 | (bury-buffer))) | ||
| 2312 | |||
| 2313 | ;;;###autoload | 2291 | ;;;###autoload |
| 2314 | (defun ibuffer-list-buffers (&optional files-only) | 2292 | (defun ibuffer-list-buffers (&optional files-only) |
| 2315 | "Display a list of buffers, in another window. | 2293 | "Display a list of buffers, in another window. |
| @@ -2350,7 +2328,6 @@ FORMATS is the value to use for `ibuffer-formats'. | |||
| 2350 | (interactive "P") | 2328 | (interactive "P") |
| 2351 | (when ibuffer-use-other-window | 2329 | (when ibuffer-use-other-window |
| 2352 | (setq other-window-p t)) | 2330 | (setq other-window-p t)) |
| 2353 | (setq ibuffer-prev-window-config (current-window-configuration)) | ||
| 2354 | (let ((buf (get-buffer-create (or name "*Ibuffer*")))) | 2331 | (let ((buf (get-buffer-create (or name "*Ibuffer*")))) |
| 2355 | (if other-window-p | 2332 | (if other-window-p |
| 2356 | (funcall (if noselect (lambda (buf) (display-buffer buf t)) #'pop-to-buffer) buf) | 2333 | (funcall (if noselect (lambda (buf) (display-buffer buf t)) #'pop-to-buffer) buf) |
| @@ -2362,8 +2339,7 @@ FORMATS is the value to use for `ibuffer-formats'. | |||
| 2362 | (select-window (get-buffer-window buf 0)) | 2339 | (select-window (get-buffer-window buf 0)) |
| 2363 | (or (derived-mode-p 'ibuffer-mode) | 2340 | (or (derived-mode-p 'ibuffer-mode) |
| 2364 | (ibuffer-mode)) | 2341 | (ibuffer-mode)) |
| 2365 | (setq ibuffer-restore-window-config-on-quit other-window-p) | 2342 | (when shrink |
| 2366 | (when shrink | ||
| 2367 | (setq ibuffer-shrink-to-minimum-size shrink)) | 2343 | (setq ibuffer-shrink-to-minimum-size shrink)) |
| 2368 | (when qualifiers | 2344 | (when qualifiers |
| 2369 | (require 'ibuf-ext) | 2345 | (require 'ibuf-ext) |
| @@ -2501,7 +2477,6 @@ Other commands: | |||
| 2501 | '\\[ibuffer-switch-format]' - Change the current display format. | 2477 | '\\[ibuffer-switch-format]' - Change the current display format. |
| 2502 | '\\[forward-line]' - Move point to the next line. | 2478 | '\\[forward-line]' - Move point to the next line. |
| 2503 | '\\[previous-line]' - Move point to the previous line. | 2479 | '\\[previous-line]' - Move point to the previous line. |
| 2504 | '\\[ibuffer-quit]' - Bury the Ibuffer buffer. | ||
| 2505 | '\\[describe-mode]' - This help. | 2480 | '\\[describe-mode]' - This help. |
| 2506 | '\\[ibuffer-diff-with-file]' - View the differences between this buffer | 2481 | '\\[ibuffer-diff-with-file]' - View the differences between this buffer |
| 2507 | and its associated file. | 2482 | and its associated file. |
| @@ -2616,7 +2591,6 @@ will be inserted before the group at point." | |||
| 2616 | (set (make-local-variable 'ibuffer-cached-eliding-string) nil) | 2591 | (set (make-local-variable 'ibuffer-cached-eliding-string) nil) |
| 2617 | (set (make-local-variable 'ibuffer-cached-elide-long-columns) nil) | 2592 | (set (make-local-variable 'ibuffer-cached-elide-long-columns) nil) |
| 2618 | (set (make-local-variable 'ibuffer-current-format) nil) | 2593 | (set (make-local-variable 'ibuffer-current-format) nil) |
| 2619 | (set (make-local-variable 'ibuffer-restore-window-config-on-quit) nil) | ||
| 2620 | (set (make-local-variable 'ibuffer-did-modification) nil) | 2594 | (set (make-local-variable 'ibuffer-did-modification) nil) |
| 2621 | (set (make-local-variable 'ibuffer-tmp-hide-regexps) nil) | 2595 | (set (make-local-variable 'ibuffer-tmp-hide-regexps) nil) |
| 2622 | (set (make-local-variable 'ibuffer-tmp-show-regexps) nil) | 2596 | (set (make-local-variable 'ibuffer-tmp-show-regexps) nil) |