help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: save/restore frame positions


From: Kevin Rodgers
Subject: Re: save/restore frame positions
Date: Wed, 17 May 2006 13:37:13 -0600
User-agent: Thunderbird 1.5.0.2 (Windows/20060308)

Robin Dunn wrote:
> Drew Adams wrote:
>> A frame configuration saves the sizes and positions (and more) of all
>> frames. It is not, however, persistent. What you want to do is save a
>> frame configuration across Emacs sessions. That is the only code you
>> would need to write.
>>
>> I believe, however, that there are already libraries that do that.
>> desktop.el is one that comes to mind, but I have never used it - someone
>> else can confirm or correct this.
>
> I also use desktop.el, and have for several years.  It is primarily
> focused on saving the list of buffers with their files, directories,
> point and mark and various buffer-local variables.  If it can save frame
> configs I haven't seen how to do it, but perhaps that would make a good
> extension...  If I have some more time to spend on this perhaps I will
> give it a try.

The RegConfig node (titled "Saving Window Configurations in Registers")
of the Emacs manual suggests saving and restoring frame configurations
via a register.  And desktop-globals-to-save includes register-alist by
default.

So if you make sure you save the frame configuration in a register
before exiting, you should be able to restore it after desktop-read has
reset the global variables:

(add-hook 'desktop-save-hook
          (lambda ()
            (frame-configuration-to-register ?f)))

(add-hook 'desktop-after-read-hook
          (lambda ()
            (jump-to-register ?f)))

Does that work?

--
Kevin





reply via email to

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