From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Window configurations Date: Sun, 02 May 2010 23:28:09 +0300 Organization: JURTA Message-ID: <871vdu6qn5.fsf@mail.jurta.org> References: <4BB4CF6B.2000007@alice.it> <87eii63v4j.fsf@mail.jurta.org> <0840B3F4D9E84706874EDD2CA2CC4236@us.oracle.com> <87vdbhgqgd.fsf@mail.jurta.org> <828BB36311A84C43B96D1F2A559DACAE@us.oracle.com> <87d3xo662u.fsf@mail.jurta.org> <69D40D69CC6F4982A8E91D8D8F0F494F@us.oracle.com> <87r5m4hz39.fsf@mail.jurta.org> <4BD40821.70808@gmx.at> <87zl0rtmqy.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272832752 4025 80.91.229.12 (2 May 2010 20:39:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 2 May 2010 20:39:12 +0000 (UTC) Cc: martin rudalics , Emacs To: Ken Hori Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 02 22:39:10 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O8fwT-00024P-Nt for ged-emacs-devel@m.gmane.org; Sun, 02 May 2010 22:39:10 +0200 Original-Received: from localhost ([127.0.0.1]:38109 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8fwT-0006TX-69 for ged-emacs-devel@m.gmane.org; Sun, 02 May 2010 16:39:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O8fva-0005xh-D8 for emacs-devel@gnu.org; Sun, 02 May 2010 16:38:14 -0400 Original-Received: from [140.186.70.92] (port=42373 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8fvV-0005wU-4b for emacs-devel@gnu.org; Sun, 02 May 2010 16:38:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O8fvS-00051H-1n for emacs-devel@gnu.org; Sun, 02 May 2010 16:38:08 -0400 Original-Received: from smtp-out2.starman.ee ([85.253.0.4]:35254 helo=mx2.starman.ee) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O8fvR-000511-RJ for emacs-devel@gnu.org; Sun, 02 May 2010 16:38:05 -0400 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (82.131.92.108.cable.starman.ee [82.131.92.108]) by mx2.starman.ee (Postfix) with ESMTP id 2B6CC3F4092; Sun, 2 May 2010 23:37:58 +0300 (EEST) In-Reply-To: (Ken Hori's message of "Thu, 29 Apr 2010 20:19:24 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:124444 Archived-At: > Could we add as an extra `buffer-file-name' alist element in the sexp > of a window-configuration or is that a bad idea? (I was just tring to > reconstruct a window-configuration after an emacs reboot but quickly > found out filenames weren't just there.) I think that information about file names is redundant. To restore file buffers in windows of the saved window configuration, you can prepare buffers (open files, call packages that create special buffers, etc.), keep their buffer objects and use them later during restoring the saved window configuration. For instance, (setq buffer1 (find-file-noselect "file1.txt")) (setq buffer2 (find-file-noselect "file2.txt")) (set-window-configuration-from-list '(window-configuration (frame-cols . 80) (frame-lines . 41) (window (buffer . buffer1) (left-col . 0) (top-line . 5) (total-cols . 86) (total-lines . 35) ...) (window (buffer . buffer2) (left-col . 0) (top-line . 5) (total-cols . 86) (total-lines . 35) ...))) This is basically what desktop.el does: it restores buffers, and later it can restore window configurations using restored buffer names. -- Juri Linkov http://www.jurta.org/emacs/