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: How to restore the layout? Date: Tue, 25 Jun 2013 09:03:49 +0300 Organization: JURTA Message-ID: <874ncmdcti.fsf@mail.jurta.org> References: <51C5AA68.4000204@alice.it> <51C6B138.50903@gmx.at> <51C6CF57.9030203@alice.it> <51C87C3E.90904@gmx.at> <83ehbrju1d.fsf@gnu.org> <87r4frcq9v.fsf@rosalinde.fritz.box> <87vc5345t3.fsf@gmail.com> <51C8B2C8.4000803@gmx.at> <87d2rbulk4.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1372140898 26718 80.91.229.3 (25 Jun 2013 06:14:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Jun 2013 06:14:58 +0000 (UTC) Cc: Angelo Graziosi , Emacs developers , martin rudalics , Eli Zaretskii , Stephen Berman , Jambunathan K To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 25 08:14:59 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 1UrMWp-0006RF-H9 for ged-emacs-devel@m.gmane.org; Tue, 25 Jun 2013 08:14:59 +0200 Original-Received: from localhost ([::1]:36483 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrMWo-0004gV-U7 for ged-emacs-devel@m.gmane.org; Tue, 25 Jun 2013 02:14:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrMWl-0004gK-Ot for emacs-devel@gnu.org; Tue, 25 Jun 2013 02:14:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrMWk-0001Ar-Fb for emacs-devel@gnu.org; Tue, 25 Jun 2013 02:14:55 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:41167 helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrMWi-00016r-Vl; Tue, 25 Jun 2013 02:14:53 -0400 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 6F2E5258B9E915; Mon, 24 Jun 2013 23:14:50 -0700 (PDT) In-Reply-To: (Juanma Barranquero's message of "Tue, 25 Jun 2013 01:43:00 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 69.163.218.105 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:161007 Archived-At: >> Please increment the version number of the desktop file in >> `desktop-file-version' because the new format will be backward >> incompatible with the old one. > > Why? The window configuration is saved as a global variable. An old > desktop.el would load it, but do nothing with it... It's very good that your approach is backward compatible and doesn't require changing the format of the desktop file. >> What do you think about also >> merging it with the patch from J=E9r=E9my Compostella at >> http://lists.gnu.org/archive/html/emacs-devel/2012-01/msg00600.html >> that additionally saves the frame parameters as well. > > Yes, saving frame parameters is one of the things missing in my sample > code. I haven't looked at J=E9r=E9my Compostella's patch, but if it > already saves the frames, why merge both patches? What is lacking in > his? The difference is in the format. His patch changes the format of the desktop file that logically fits better to the design of desktop.el. Like the existing function calls `desktop-create-buffer' in the desktop file, it adds similar function calls `desktop-restore-frame': (desktop-restore-frame t '(frame1-params...) '(window-tree1...)) (desktop-restore-frame nil '(frame2-params...) '(window-tree2...)) (desktop-restore-frame nil '(frame3-params...) '(window-tree3...)) The disadvantage is that loading the new format in older Emacs versions where `desktop-restore-frame' is undefined will fail. Perhaps it could use something like (when (fboundp 'desktop-restore-frame) (desktop-restore-frame t '(frame1-params...) '(window-tree1...)) (desktop-restore-frame nil '(frame2-params...) '(window-tree2...)) (desktop-restore-frame nil '(frame3-params...) '(window-tree3...))) but isn't this too ugly? OTOH, your patch has the advantage of backward compatibility in that it uses `setq' to a new variable, and older Emacs versions will just ignore this setting. So the main question to decide is what format to use.