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

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

Re: How to pickle split window?


From: Eric Abrahamsen
Subject: Re: How to pickle split window?
Date: Sat, 09 Mar 2013 08:35:26 +0800
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2 (gnu/linux)

Haines Brown <haines@histomat.net> writes:

> jpkotta <jpkotta@gmail.com> writes:
>
>> On Friday, March 8, 2013 5:32:17 AM UTC-6, Haines Brown wrote:
>>> 
>>> What can I do to return to the split window that displays my prior
>>> state automatically after closing gnus without having to do an emacs
>>> reload
>
>> C-x r w <letter> saves the window configuration to the register
>> specified with <letter> (e.g. "a" or "z").  C-x r j <letter> restores
>> the window config stored in register <letter>.
>>
>> There are many packages that save window configurations, see
>> http://emacswiki.org/emacs/CategoryWindows#toc4.  I like
>> workgroups.el.
>
> Sorry I was not clearer. I understand there are commands to restore
> previous window layout, but my interest was for it to be automatic, so
> that for example when I close gnus, emacs returns automatically to the
> prior windows layout. It would even be nice to return automatically to
> the the prior buffers displayed in those windows.
>
> I suspect the answer to somehow to add a hook to gnus quit that
> automatically runs (defun reload ()), perhaps calling back most recent
> buffers for those windows.

It looks like there's no hook that runs before gnus starts munging
buffers. So you'd probably want to advise the gnus command (before),
store (current-window-configuration) in a variable, and then as you say
add a hook to gnus-exit-gnus-hook that checks if there's a valid
window-config in that variable, and if so read it with
(set-window-configuration).

Hope that's useful,

Eric




reply via email to

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