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 17:26:53 +0200

On Fri, Jul 5, 2013 at 5:21 PM, martin rudalics <address@hidden> wrote:

> `window-state-put' doesn't know anything about files.  It simply expects
> the window's buffer to be there.

Of course.

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

That (restoring buffer lists) would be better, but still it is
possible that no previous buffer can be found, so creating *scratch*
or defaulting to something else will still be required.

> Two remarks: I never heard about `get-buffer-create' creating any files
> or directories.

I think Angelo was just a bit sloppy with his terminology.

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

As it should. If the user plays such games, let her do it.

   J



reply via email to

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