emacs-devel
[Top][All Lists]
Advanced

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

Re: How to restore the layout?


From: martin rudalics
Subject: Re: How to restore the layout?
Date: Fri, 05 Jul 2013 17:54:06 +0200

> ..., or delete the window after restoring it (that'd be my
> preferred behavior, I think).

We could add a variable

(defvar window-state-put-stale-windows nil
    "Helper variable for `window-state-put'.")

use

    (let ((buffer ((get-buffer (car state)))))
      (if buffer        
          (set-window-buffer window buffer)
        (switch-to-prev-buffer window)
        (setq window-state-put-stale-windows
              (cons window window-state-put-stale-windows))))

as replacement and in `window-state-put' initially do

(setq window-state-put-stale-windows nil)

and before the final call to `window--check-frame' simply add a

(dolist (window window-state-put-stale-windows)
  (when (window-deletable-p window)
    (delete-window window)))

martin



reply via email to

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