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:21:36 +0200

> It's not a file, it's a buffer. Note that buffer-file-name is nil.
>
> That's a consequence of the way window-state-put currently works. Martin?

`window-state-put' doesn't know anything about files.  It simply expects
the window's buffer to be there.  But we can easily replace

        (set-window-buffer window (get-buffer-create (car state)))

by, for example,

        (set-window-buffer window (or (get-buffer (car state))
                                      (get-buffer-create "*scratch*")))

If we saved and restored window-local buffer lists, we could show the
previous buffer on that window's list instead.

Two remarks: I never heard about `get-buffer-create' creating any files
or directories.  And, `window-state-put' reuses the name of the window's
buffer from the other session.  So if you have a buffer "foo" in the old
session and a completely different buffer "foo" in the new session, it
will show that other buffer instead.

martin



reply via email to

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