1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00

(ibuffer-delete-window-on-quit): Remove.

(ibuffer-restore-window-config-on-quit): New variable to replace
`ibuffer-delete-window-on-quit'.  Update all references.
(ibuffer-prev-window-config): New variable.
(ibuffer-quit): Restore previous window configuration instead of deleting
window.
(ibuffer): Save window configuration before showing Ibuffer buffer.
This commit is contained in:
John Paul Wallington 2004-04-12 10:03:08 +00:00
parent a2295d3268
commit 4ed1f829e2
2 changed files with 24 additions and 8 deletions

View File

@ -1,3 +1,14 @@
2004-04-12 John Paul Wallington <jpw@gnu.org>
* ibuffer.el (ibuffer-delete-window-on-quit): Remove.
(ibuffer-restore-window-config-on-quit): New variable to replace
`ibuffer-delete-window-on-quit'. Update all references.
(ibuffer-prev-window-config): New variable.
(ibuffer-quit): Restore previous window configuration instead of
deleting window.
(ibuffer): Save window configuration before showing Ibuffer
buffer.
2004-04-12 Stefan Monnier <monnier@iro.umontreal.ca> 2004-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/compile.el (compilation-mode-font-lock-keywords): Fix test * progmodes/compile.el (compilation-mode-font-lock-keywords): Fix test

View File

@ -786,8 +786,11 @@ directory, like `default-directory'."
(define-key map [down-mouse-3] 'ibuffer-mouse-popup-menu) (define-key map [down-mouse-3] 'ibuffer-mouse-popup-menu)
map)) map))
(defvar ibuffer-delete-window-on-quit nil (defvar ibuffer-restore-window-config-on-quit nil
"Whether or not to delete the window upon exiting `ibuffer'.") "If non-nil, restore previous window configuration upon exiting `ibuffer'.")
(defvar ibuffer-prev-window-config nil
"Window configuration before starting Ibuffer.")
(defvar ibuffer-did-modification nil) (defvar ibuffer-did-modification nil)
@ -2183,13 +2186,14 @@ If optional arg SILENT is non-nil, do not display progress messages."
(defun ibuffer-quit () (defun ibuffer-quit ()
"Quit this `ibuffer' session. "Quit this `ibuffer' session.
Delete the current window iff `ibuffer-delete-window-on-quit' is non-nil." Try to restore the previous window configuration iff
`ibuffer-restore-window-config-on-quit' is non-nil."
(interactive) (interactive)
(if ibuffer-delete-window-on-quit (if ibuffer-restore-window-config-on-quit
(progn (progn
(bury-buffer) (bury-buffer)
(unless (= (count-windows) 1) (unless (= (count-windows) 1)
(delete-window))) (set-window-configuration ibuffer-prev-window-config)))
(bury-buffer))) (bury-buffer)))
;;;###autoload ;;;###autoload
@ -2232,6 +2236,7 @@ locally in this buffer."
(interactive "P") (interactive "P")
(when ibuffer-use-other-window (when ibuffer-use-other-window
(setq other-window-p t)) (setq other-window-p t))
(setq ibuffer-prev-window-config (current-window-configuration))
(let ((buf (get-buffer-create (or name "*Ibuffer*")))) (let ((buf (get-buffer-create (or name "*Ibuffer*"))))
(if other-window-p (if other-window-p
(funcall (if noselect #'(lambda (buf) (display-buffer buf t)) #'pop-to-buffer) buf) (funcall (if noselect #'(lambda (buf) (display-buffer buf t)) #'pop-to-buffer) buf)
@ -2243,7 +2248,7 @@ locally in this buffer."
(select-window (get-buffer-window buf)) (select-window (get-buffer-window buf))
(or (eq major-mode 'ibuffer-mode) (or (eq major-mode 'ibuffer-mode)
(ibuffer-mode)) (ibuffer-mode))
(setq ibuffer-delete-window-on-quit other-window-p) (setq ibuffer-restore-window-config-on-quit other-window-p)
(when shrink (when shrink
(setq ibuffer-shrink-to-minimum-size shrink)) (setq ibuffer-shrink-to-minimum-size shrink))
(when qualifiers (when qualifiers
@ -2470,7 +2475,7 @@ will be inserted before the group at point."
(set (make-local-variable 'ibuffer-cached-eliding-string) nil) (set (make-local-variable 'ibuffer-cached-eliding-string) nil)
(set (make-local-variable 'ibuffer-cached-elide-long-columns) nil) (set (make-local-variable 'ibuffer-cached-elide-long-columns) nil)
(set (make-local-variable 'ibuffer-current-format) nil) (set (make-local-variable 'ibuffer-current-format) nil)
(set (make-local-variable 'ibuffer-delete-window-on-quit) nil) (set (make-local-variable 'ibuffer-restore-window-config-on-quit) nil)
(set (make-local-variable 'ibuffer-did-modification) nil) (set (make-local-variable 'ibuffer-did-modification) nil)
(set (make-local-variable 'ibuffer-tmp-hide-regexps) nil) (set (make-local-variable 'ibuffer-tmp-hide-regexps) nil)
(set (make-local-variable 'ibuffer-tmp-show-regexps) nil) (set (make-local-variable 'ibuffer-tmp-show-regexps) nil)