[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Saving the frame layout between frames
From: |
Alex Bennée |
Subject: |
Re: Saving the frame layout between frames |
Date: |
Mon, 28 Oct 2013 12:50:29 +0000 |
User-agent: |
mu4e 0.9.9.6pre2; emacs 24.3.1 |
In-reply-to: <jwvppqq8bho.fsf-monnier+gmane.emacs.help@gnu.org>
monnier@iro.umontreal.ca writes:
>> (setq crmbk-previous-frame-config (current-window-configuration))
>
> window-configurations can't be transferred between frames.
> In recent Emacsen, a new data-structure was introduced which can be used
> between frames, called `window-state'.
>
> You can use window-state-get and then window-state-put.
That almost works. I've certainly got a structure that I can use to
reset the frame configuration manually now. However if I call it in the
new frame handler:
(defun crmbk-new-frame-handler (frame)
"Do any appropriate set-up on new frame creation.
This is intended to be called during after-make-frame-functions"
(when (frame-parameter frame 'display)
(set-frame-parameter frame 'fullscreen 'fullboth)
(setq crmbk-current-frame frame)
(when crmbk-previous-frame-config
(window-state-put crmbk-previous-frame-config))
(crmbk-frame-mode t)))
The new frame hangs until I C-g at which point *Messages* reads:
window-state-put: Window #<window 1 on *scratch*> too small to accommodate state
Quit
Error in post-command-hook (winner-save-old-configurations): (error "Window is
on a different frame")
Should I restore the frame configuration on a later hook?
--
Alex Bennée