[Top][All Lists]

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

Re: How to restore the layout?

From: Angelo Graziosi
Subject: Re: How to restore the layout?
Date: Fri, 05 Jul 2013 19:04:45 +0200
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7

Il 05/07/2013 17.26, Juanma Barranquero ha scritto:
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.

Obviously, in my example, the buffer "restored", ~/applications/foo.cpp doesn't exit on disk, it is a sort of "virtual" buffer.

Anyway, if I remove a *real* file ~/foo.cpp (because, for example, I don't need it any more), then restarting Emacs I cannot have a "virtual" buffer ~/applications/foo.cpp! I would expect that Emacs behaves as before the introduction of "desktop-restore-frames", i.e. a message in *Messages*, saying something like

 "... failure restoring  ~/foo.cpp because not found..."

This would be OK..


reply via email to

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