From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Hori Newsgroups: gmane.emacs.devel Subject: Re: Window configurations Date: Sun, 2 May 2010 20:31:56 -0700 Message-ID: References: <4BB4CF6B.2000007@alice.it> <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> <871vdu6qn5.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1272857529 30675 80.91.229.12 (3 May 2010 03:32:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 3 May 2010 03:32:09 +0000 (UTC) Cc: martin rudalics , Emacs To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 03 05:32:08 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 1O8mO7-0000Jz-Rq for ged-emacs-devel@m.gmane.org; Mon, 03 May 2010 05:32:08 +0200 Original-Received: from localhost ([127.0.0.1]:55515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8mO7-0007iu-6K for ged-emacs-devel@m.gmane.org; Sun, 02 May 2010 23:32:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O8mO1-0007if-PB for emacs-devel@gnu.org; Sun, 02 May 2010 23:32:01 -0400 Original-Received: from [140.186.70.92] (port=40218 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8mO0-0007iX-FU for emacs-devel@gnu.org; Sun, 02 May 2010 23:32:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O8mNy-0005CR-Rn for emacs-devel@gnu.org; Sun, 02 May 2010 23:32:00 -0400 Original-Received: from mail-pv0-f169.google.com ([74.125.83.169]:52617) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O8mNy-0005CH-MY for emacs-devel@gnu.org; Sun, 02 May 2010 23:31:58 -0400 Original-Received: by pvc22 with SMTP id 22so65644pvc.0 for ; Sun, 02 May 2010 20:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=/RIgrSqCh3Tcchoz5EMR21D3LrvlWdDKNMDvW0ruo54=; b=Or7ML7WGbF+3kb87+6Lv5YaRZxuZi4Qw6JJ0KK2aJt/RBdcEC9dubzNvZxHJVaryVj m9AjN9WhQCl4xFHiUc1yNRrEKfszVIfCygrYxwxWhV2Qkw/wYyryROT5sPT+po2HGxwg S/eBzHxPJMPY3JsymOdkNcxRqv9NrbtQBteIQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=HXj9hODsVuCuduzFwpdU47bBKUon3KfH2FpepJIn/SKsqaroK289cnyyqojxyOipsm B+1eabk6LOcaG5k147jEWbUNrlyGpS8Md7QfvUPwaG3twuXoqrE4a4GU4eXlybUGdu6Z ewVsdSr6kTN9N7LqlwxK0mtCojcweHsmOpwk4= Original-Received: by 10.141.101.19 with SMTP id d19mr3171505rvm.154.1272857516909; Sun, 02 May 2010 20:31:56 -0700 (PDT) Original-Received: by 10.141.2.15 with HTTP; Sun, 2 May 2010 20:31:56 -0700 (PDT) In-Reply-To: <871vdu6qn5.fsf@mail.jurta.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:124463 Archived-At: Juri, My point was that you wound't be able to open a file without knowing buffer-file-name once emacs gets closed. In particular, if a window-configuration-sexp doesn't contain such a thing as buffer-file-name, you wound't be able to reconstruct > (setq buffer1 (find-file-noselect "")) since gets lost upon exit. Of course you can store for each file buffer "somewhere", but I thought the point of having window-configuration-sexp's is to save that kind of extra work and provide a canonical way of restoring frame states. I was hoping that ideally emacs would hold buffer-file-name's in the sexp and let the user specify a "buffer-recovery-function" to recover a frame state as well as buffers, so that, hypothetically, (restore-window-configuration-from-sexp a-window-configuration-sexp 'live-p #'find-file-noselect) would restore buffers as well as a window configuration. On Sun, May 2, 2010 at 1:28 PM, Juri Linkov wrote: >> 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. =A0For instance, > > (setq buffer1 (find-file-noselect "file1.txt")) > (setq buffer2 (find-file-noselect "file2.txt")) > > (set-window-configuration-from-list > =A0'(window-configuration > =A0 =A0 (frame-cols . 80) > =A0 =A0 (frame-lines . 41) > =A0 =A0 (window > =A0 =A0 =A0 (buffer . buffer1) > =A0 =A0 =A0 (left-col . 0) > =A0 =A0 =A0 (top-line . 5) > =A0 =A0 =A0 (total-cols . 86) > =A0 =A0 =A0 (total-lines . 35) > =A0 =A0 =A0 ...) > =A0 =A0 (window > =A0 =A0 =A0 (buffer . buffer2) > =A0 =A0 =A0 (left-col . 0) > =A0 =A0 =A0 (top-line . 5) > =A0 =A0 =A0 (total-cols . 86) > =A0 =A0 =A0 (total-lines . 35) > =A0 =A0 =A0 ...))) > > 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/ >