unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: um.kiwon@gmail.com
Cc: help-gnu-emacs@gnu.org
Subject: Re: session management with desktop and window configuration
Date: Thu, 31 Dec 2009 12:31:55 +0100	[thread overview]
Message-ID: <4B3C8BAB.7000607@gmx.at> (raw)

 > I'm now using desktop.el for managing sessions. When I do desktop-
 > read, it restore all files opened before well. Then, I'm wondering if
 > there is any way to restore window configuration as well in easy way.
 > Firstly, I tried to add some functions to the desktop hooks as
 > follows:
 >   (add-hook 'desktop-save-hook '(window-configuration-to-register ?0))
 >   (add-hook 'desktop-after-read-hook '(jump-to-register ?0))
 > However, it didn't work at all.
 >
 > The register-base window configuration save/restore are perfect to
 > what I want. But I don't know how to integrate it with desktop. Please
 > give me help.

You can't do this with desktop at the moment.  The basic problem is that
we currently cannot read window configurations from a file - a window
configuration can only be saved in memory and retrieved from there.
This obviously means that when you exit Emacs your saved window
configurations are lost forever.  In this context note also that you
can't cleanly restore a window configuration in one and the same session
if you have deleted its frame in the meantime.

Basically you should be able to write a configuration to a file as a
sequence of `split-window' functions (and some interspersed window
resizings) and execute these commands when you restart Emacs.  But you
might end up getting only an approximation of the earlier configuration
partly due to the quite unpredictable behavior of the current window
resizing code which can, for example, deliberately delete windows when
they become too small.

I'm currently contemplating functions that write window configurations
to a file and read them from there.  This way I can circumvent the
window splitting mechanism and directly construct a window-tree from the
information on the file.  This should solve the problem for you.

Meanwhile you could try out ECB which does something similar to what you
want.

martin




             reply	other threads:[~2009-12-31 11:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-31 11:31 martin rudalics [this message]
2009-12-31 13:21 ` session management with desktop and window configuration Kiwon Um
2009-12-31 13:33   ` Lennart Borgman
2009-12-31 16:16     ` Richard Riley
2009-12-31 16:22       ` Lennart Borgman
2009-12-31 16:32         ` Richard Riley
2009-12-31 17:33           ` Vicente Hernando Ara
2010-01-01  1:25             ` Lennart Borgman
2009-12-31 17:32     ` martin rudalics
2010-01-01  1:27       ` Lennart Borgman
2010-01-01 14:55         ` martin rudalics
2010-01-01 15:04           ` Lennart Borgman
2010-01-01 15:18             ` martin rudalics
2009-12-31 17:31   ` martin rudalics
2010-01-01  1:29     ` Lennart Borgman
     [not found] <mailman.476.1262259127.18930.help-gnu-emacs@gnu.org>
2010-01-07  0:48 ` David Combs
  -- strict thread matches above, loose matches on Subject: below --
2009-12-31 10:08 Kiwon Um

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B3C8BAB.7000607@gmx.at \
    --to=rudalics@gmx.at \
    --cc=help-gnu-emacs@gnu.org \
    --cc=um.kiwon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).