+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>
* progmodes/compile.el (compilation-mode-font-lock-keywords): Fix test
(define-key map [down-mouse-3] 'ibuffer-mouse-popup-menu)
map))
-(defvar ibuffer-delete-window-on-quit nil
- "Whether or not to delete the window upon exiting `ibuffer'.")
+(defvar ibuffer-restore-window-config-on-quit nil
+ "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)
(defun ibuffer-quit ()
"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)
- (if ibuffer-delete-window-on-quit
- (progn
+ (if ibuffer-restore-window-config-on-quit
+ (progn
(bury-buffer)
(unless (= (count-windows) 1)
- (delete-window)))
+ (set-window-configuration ibuffer-prev-window-config)))
(bury-buffer)))
;;;###autoload
(interactive "P")
(when ibuffer-use-other-window
(setq other-window-p t))
+ (setq ibuffer-prev-window-config (current-window-configuration))
(let ((buf (get-buffer-create (or name "*Ibuffer*"))))
(if other-window-p
(funcall (if noselect #'(lambda (buf) (display-buffer buf t)) #'pop-to-buffer) buf)
(select-window (get-buffer-window buf))
(or (eq major-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
(setq ibuffer-shrink-to-minimum-size shrink))
(when qualifiers
(set (make-local-variable 'ibuffer-cached-eliding-string) nil)
(set (make-local-variable 'ibuffer-cached-elide-long-columns) 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-tmp-hide-regexps) nil)
(set (make-local-variable 'ibuffer-tmp-show-regexps) nil)