From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.help Subject: Re: session management with desktop and window configuration Date: Thu, 31 Dec 2009 12:31:55 +0100 Message-ID: <4B3C8BAB.7000607@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1262259160 2218 80.91.229.12 (31 Dec 2009 11:32:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Dec 2009 11:32:40 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: um.kiwon@gmail.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 31 12:32:32 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NQJGa-000060-CD for geh-help-gnu-emacs@m.gmane.org; Thu, 31 Dec 2009 12:32:32 +0100 Original-Received: from localhost ([127.0.0.1]:36316 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NQJGa-00020e-EZ for geh-help-gnu-emacs@m.gmane.org; Thu, 31 Dec 2009 06:32:32 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NQJGA-0001z3-0m for help-gnu-emacs@gnu.org; Thu, 31 Dec 2009 06:32:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NQJG3-0001t9-T5 for help-gnu-emacs@gnu.org; Thu, 31 Dec 2009 06:32:05 -0500 Original-Received: from [199.232.76.173] (port=35556 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NQJG3-0001sp-O7 for help-gnu-emacs@gnu.org; Thu, 31 Dec 2009 06:31:59 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]:35597) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1NQJG3-0002oj-0b for help-gnu-emacs@gnu.org; Thu, 31 Dec 2009 06:31:59 -0500 Original-Received: (qmail invoked by alias); 31 Dec 2009 11:31:55 -0000 Original-Received: from 62-47-59-84.adsl.highway.telekom.at (EHLO [62.47.59.84]) [62.47.59.84] by mail.gmx.net (mp067) with SMTP; 31 Dec 2009 12:31:55 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/jsX9JxnvjAQnUWRQO3MF54BRCi20tq5wdLF3vO0 h3RbCNmXOWCDZf User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) Original-References: 34fbbf2f-6bdf-459f-84f0-d7ade4ba87b1@f5g2000yqh.googlegroups.com X-Y-GMX-Trusted: 0 X-FuHaFi: 0.72 X-detected-operating-system: by monty-python.gnu.org: Error: [-] ERROR: /var/run/p0f.sock: Connection refused 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:70972 Archived-At: > 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