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: Juanma Barranquero
Subject: Re: How to restore the layout?
Date: Fri, 5 Jul 2013 18:02:32 +0200

> 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)

Why? In case the window cannot be deleted?

>         (setq window-state-put-stale-windows
>               (cons window window-state-put-stale-windows))))

AKA (push window window-state-put-stale-windows)

> 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)))

(ignore-errors (delete-window window))

to protect only windows (i.e., when window-deletable-p returns `frame').

I like this.

    J



reply via email to

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