From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: How to restore the layout? Date: Fri, 05 Jul 2013 17:21:36 +0200 Message-ID: <51D6E480.80407@gmx.at> References: <51C5AA68.4000204@alice.it> <83fvw2g44j.fsf@gnu.org> <51CE9B05.1090202@gmx.at> <51CFFBED.7090400@gmx.at> <51D02AB0.5070103@gmx.at> <51D5DE14.4090507@alice.it> <51D600D8.90801@alice.it> <51D67990.3090800@gmx.at> <51D6D1E1.10902@alice.it> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1373037710 19125 80.91.229.3 (5 Jul 2013 15:21:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Jul 2013 15:21:50 +0000 (UTC) Cc: Emacs developers , Angelo Graziosi To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 05 17:21:51 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Uv7pW-0008Dr-Uk for ged-emacs-devel@m.gmane.org; Fri, 05 Jul 2013 17:21:51 +0200 Original-Received: from localhost ([::1]:45434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uv7pW-0008R7-HL for ged-emacs-devel@m.gmane.org; Fri, 05 Jul 2013 11:21:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uv7pS-0008QP-Kz for emacs-devel@gnu.org; Fri, 05 Jul 2013 11:21:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uv7pR-0004sm-3e for emacs-devel@gnu.org; Fri, 05 Jul 2013 11:21:46 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:56085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uv7pQ-0004sa-PG for emacs-devel@gnu.org; Fri, 05 Jul 2013 11:21:44 -0400 Original-Received: from [62.47.48.72] ([62.47.48.72]) by mail.gmx.com (mrgmx102) with ESMTPA (Nemesis) id 0Meutp-1UbYmV1upd-00ObdH; Fri, 05 Jul 2013 17:21:42 +0200 In-Reply-To: X-Provags-ID: V03:K0:Y1kC/6Cj80b/2ySj+BIrhaDevWSv2TxC5O/MCsYUdydVQKvCUnJ X/LnY7rIMy5jVzpYetjulbFddQa5UZRPFpuc5nxuyId3ZiKOvT+/j4Hw4pkqblhY53NXYmz UhdIxDbMv+I1iggu44k7QibePZBM2wR0AdZHTOhrKrWKoGcrqrChveuopX8lAaay2+g7K4P ZsL4Q9iHQeG11wOsj4dNQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.21 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:161594 Archived-At: > It's not a file, it's a buffer. Note that buffer-file-name is nil. > > That's a consequence of the way window-state-put currently works. Martin? `window-state-put' doesn't know anything about files. It simply expects the window's buffer to be there. But we can easily replace (set-window-buffer window (get-buffer-create (car state))) by, for example, (set-window-buffer window (or (get-buffer (car state)) (get-buffer-create "*scratch*"))) If we saved and restored window-local buffer lists, we could show the previous buffer on that window's list instead. Two remarks: I never heard about `get-buffer-create' creating any files or directories. And, `window-state-put' reuses the name of the window's buffer from the other session. So if you have a buffer "foo" in the old session and a completely different buffer "foo" in the new session, it will show that other buffer instead. martin