From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: save/restore frame positions Date: Wed, 17 May 2006 13:37:13 -0600 Organization: IHS Message-ID: References: <126mdph5alfgra0@corp.supernews.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1147894711 31399 80.91.229.2 (17 May 2006 19:38:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 17 May 2006 19:38:31 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 17 21:38:29 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FgRqm-0006a6-2h for geh-help-gnu-emacs@m.gmane.org; Wed, 17 May 2006 21:38:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FgRql-0003BA-JC for geh-help-gnu-emacs@m.gmane.org; Wed, 17 May 2006 15:38:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FgRqW-00039V-AU for help-gnu-emacs@gnu.org; Wed, 17 May 2006 15:38:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FgRqT-00038C-9I for help-gnu-emacs@gnu.org; Wed, 17 May 2006 15:38:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FgRqT-000385-1l for help-gnu-emacs@gnu.org; Wed, 17 May 2006 15:38:09 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FgRtO-00057D-3M for help-gnu-emacs@gnu.org; Wed, 17 May 2006 15:41:10 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FgRqM-0006WA-Bb for help-gnu-emacs@gnu.org; Wed, 17 May 2006 21:38:03 +0200 Original-Received: from 207.167.42.206 ([207.167.42.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 17 May 2006 21:38:02 +0200 Original-Received: from ihs_4664 by 207.167.42.206 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 17 May 2006 21:38:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 39 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.206 User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) In-Reply-To: <126mdph5alfgra0@corp.supernews.com> X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35116 Archived-At: 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