[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Persistent Window Registers
From: |
Lennart Borgman |
Subject: |
Re: Persistent Window Registers |
Date: |
Wed, 7 Jan 2009 23:26:39 +0100 |
On Wed, Jan 7, 2009 at 2:03 PM, Volkan YAZICI <volkan.yazici@gmail.com> wrote:
> On Jan 5, 12:50 pm, "Lennart Borgman" <lennart.borg...@gmail.com>
> wrote:
>> See winsav.el in nXhtml
>
> After spending some time, I found out that there is no easy way to
> save window configurations. Instead, as nXhtml, people
Hi Volkan,
I am not sure what you mean and it is a long time since I wrote
winsav.el. Are the things you need missing in winsav.el?
> 1. Walk through available window configurations they are interested
> in,
>
> 2. Copy attributes (buffer name, buffer start/end position, etc.) of
> the walked windows,
>
> And in later sessions, using saved window attributes
>
> 3. Open same buffers one by one in specific windows,
>
> 4. Then resize opened windows according to the saved attributes.
>
> On Jan 4, 6:10 pm, Volkan YAZICI <volkan.yaz...@gmail.com> wrote:
>> - C-x r j 1 (*Group*)
>> - C-x r j 2 (#postgresql and #lisp buffers divided vertically)
>
> To summarize, here is the solution I came up with:
>
> (defun erc-register-window-configuration ()
> "Register vertically split `#postgresql' and `#lisp' channel windows
> into
> configuration 2."
> (let ((psql-buf (get-buffer "#postgresql"))
> (lisp-buf (get-buffer "#lisp")))
> (cond ((and psql-buf lisp-buf)
> (switch-to-buffer psql-buf)
> (delete-other-windows)
> (recenter)
> (select-window (split-window-horizontally))
> (switch-to-buffer lisp-buf)
> (recenter)
> (window-configuration-to-register ?2))
> (t (warn "Couldn't find buffers `#postgresql' and `#lisp'.")))))
>
> (add-hook 'erc-join-hook 'erc-register-window-configuration)
>
> (defun gnus-register-window-configuration ()
> "Register a whole `*Group*' buffer window into configuration 1."
> (let ((group-buf (get-buffer "*Group*")))
> (when group-buf
> (switch-to-buffer group-buf)
> (delete-other-windows)
> (beginning-of-buffer)
> (window-configuration-to-register ?1))))
>
> (add-hook 'gnus-started-hook 'gnus-register-window-configuration)
>
>
> Regards.
>
Re: Persistent Window Registers, Volkan YAZICI, 2009/01/08