unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Saving the frame layout between frames
@ 2013-10-27 19:10 Alex Bennée
  2013-10-27 19:50 ` Tim Visher
  2013-10-28  0:54 ` Stefan Monnier
  0 siblings, 2 replies; 7+ messages in thread
From: Alex Bennée @ 2013-10-27 19:10 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

Following on from my previous adventures with chromebook.el I'm now
trying to save the frame layout so when I create a new frame I can
restore the layout of the buffers and windows as they where.

I've been using:

(setq crmbk-previous-frame-config (current-window-configuration))

However when the new frame is created and I run:

(when crmbk-previous-frame-config
  (set-window-configuration crmbk-previous-frame-config))

It's not working. If I run these commands from within a frame after
messing around with the configuration it works as expected so I assume
the breakage is caused by the fact the new frame context is incompatible
(indeed winner-mode doesn't seem to save window configuration between
frame instances).

So is there any way around this?

-- 
Alex Bennée




^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: Saving the frame layout between frames
@ 2013-10-28 17:52 martin rudalics
  0 siblings, 0 replies; 7+ messages in thread
From: martin rudalics @ 2013-10-28 17:52 UTC (permalink / raw)
  To: kernel-hacker; +Cc: help-gnu-emacs

 > (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))

I suppose what you want here is

   (when crmbk-previous-frame-config
     (window-state-put
      crmbk-previous-frame-config (frame-root-window frame)))

Note that running `after-make-frame-functions' doesn't select the new
frame.

 >     (crmbk-frame-mode t)))

martin



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-10-28 17:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-27 19:10 Saving the frame layout between frames Alex Bennée
2013-10-27 19:50 ` Tim Visher
2013-10-28  0:54 ` Stefan Monnier
2013-10-28 12:50   ` Alex Bennée
2013-10-28 14:20     ` Stefan Monnier
2013-10-28 17:38       ` Alex Bennée
  -- strict thread matches above, loose matches on Subject: below --
2013-10-28 17:52 martin rudalics

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).