[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quit-window

From: martin rudalics
Subject: Re: quit-window
Date: Tue, 25 Oct 2011 15:01:46 +0200
User-agent: Thunderbird (Windows/20090302)

> Take this:
> (defun ibuffer-quit ()
>   "Quit this `ibuffer' session.
> Try to restore the previous window configuration if
> `ibuffer-restore-window-config-on-quit' is non-nil."
>   (interactive)
>   (if ibuffer-restore-window-config-on-quit
>       (progn
>    (bury-buffer)
>    (unless (= (count-windows) 1)
>      (set-window-configuration ibuffer-prev-window-config)))
>     (bury-buffer)))

The problem is already in `ibuffer' itself:

  (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)
      (funcall (if noselect #'display-buffer #'switch-to-buffer) buf))

Saving the window configuration doesn't make sense if one of the
funcalls makes a new frame.

> Here I am wondering if the same couldn't be achieved by a call to
> (the new and improved) `quit-window'.

I hope it does.  But this is something users of ibuffer should try

> Something like
> (defun Info-exit (kill)

KILL should be optional here.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]