unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: save/restore frame positions
Date: Wed, 17 May 2006 13:37:13 -0600	[thread overview]
Message-ID: <e4fu2j$ugt$1@sea.gmane.org> (raw)
In-Reply-To: <126mdph5alfgra0@corp.supernews.com>

Robin Dunn wrote:
 > Drew Adams wrote:
 >> A frame configuration saves the sizes and positions (and more) of all
 >> frames. It is not, however, persistent. What you want to do is save a
 >> frame configuration across Emacs sessions. That is the only code you
 >> would need to write.
 >>
 >> I believe, however, that there are already libraries that do that.
 >> desktop.el is one that comes to mind, but I have never used it - someone
 >> else can confirm or correct this.
 >
 > I also use desktop.el, and have for several years.  It is primarily
 > focused on saving the list of buffers with their files, directories,
 > point and mark and various buffer-local variables.  If it can save frame
 > configs I haven't seen how to do it, but perhaps that would make a good
 > extension...  If I have some more time to spend on this perhaps I will
 > give it a try.

The RegConfig node (titled "Saving Window Configurations in Registers")
of the Emacs manual suggests saving and restoring frame configurations
via a register.  And desktop-globals-to-save includes register-alist by
default.

So if you make sure you save the frame configuration in a register
before exiting, you should be able to restore it after desktop-read has
reset the global variables:

(add-hook 'desktop-save-hook
	  (lambda ()
	    (frame-configuration-to-register ?f)))

(add-hook 'desktop-after-read-hook
	  (lambda ()
	    (jump-to-register ?f)))

Does that work?

-- 
Kevin

  parent reply	other threads:[~2006-05-17 19:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1924.1147819917.9609.help-gnu-emacs@gnu.org>
2006-05-17 14:45 ` save/restore frame positions Robin Dunn
2006-05-17 15:50   ` Drew Adams
2006-05-17 19:37   ` Kevin Rodgers [this message]
     [not found] <mailman.1525.1146968778.9609.help-gnu-emacs@gnu.org>
2006-05-16 22:12 ` Robin Dunn
2006-05-16 22:51   ` Drew Adams
2006-05-06 22:36 Robin Dunn
2006-05-07  2:25 ` Drew Adams
2006-05-07  2:41   ` Drew Adams
2006-05-17 22:04 ` Johan Bockgård

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='e4fu2j$ugt$1@sea.gmane.org' \
    --to=ihs_4664@yahoo.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).