From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: Michael Bach Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Dec 2011 01:40:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 10348@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.132451795330591 (code B ref -1); Thu, 22 Dec 2011 01:40:08 +0000 Received: (at submit) by debbugs.gnu.org; 22 Dec 2011 01:39:13 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RdXcj-0007wP-O6 for submit@debbugs.gnu.org; Wed, 21 Dec 2011 20:39:12 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RdSwW-0000TK-N4 for submit@debbugs.gnu.org; Wed, 21 Dec 2011 15:39:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RdSuT-00071D-UC for submit@debbugs.gnu.org; Wed, 21 Dec 2011 15:37:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:41807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdSuT-000719-Sl for submit@debbugs.gnu.org; Wed, 21 Dec 2011 15:37:09 -0500 Received: from eggs.gnu.org ([140.186.70.92]:42430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdSuS-0002dv-QT for bug-gnu-emacs@gnu.org; Wed, 21 Dec 2011 15:37:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RdSuR-00070q-PG for bug-gnu-emacs@gnu.org; Wed, 21 Dec 2011 15:37:08 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:45963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdSuR-00070k-Fg for bug-gnu-emacs@gnu.org; Wed, 21 Dec 2011 15:37:07 -0500 Received: by eekc41 with SMTP id c41so8208584eek.0 for ; Wed, 21 Dec 2011 12:37:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:mime-version:content-type; bh=fhp9staakHHR6rhgVSpIEdFzO/pma7gp37SEfsmN9yM=; b=WFJOy0/2B1w2vml1yPe4lNe7YRLJLbMSLg4ztP7XYve9Vv+5g2mJVquSjHHSB3XzUx eIt/o6epXnqeODoXA9qY2tKomfqWNadV1MKNcZCPWV9165gI7qOVqTbd61VW9XbI6MYn HE57adGnV2x9GuOgjWc4dT0cewMFs2gt132Hw= Received: by 10.213.114.140 with SMTP id e12mr1654555ebq.78.1324499826439; Wed, 21 Dec 2011 12:37:06 -0800 (PST) Received: from voschtro (chello084112087167.3.11.univie.teleweb.at. [84.112.87.167]) by mx.google.com with ESMTPS id j20sm24736908eej.8.2011.12.21.12.37.05 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Dec 2011 12:37:05 -0800 (PST) From: Michael Bach Date: Wed, 21 Dec 2011 21:41:05 +0100 Message-ID: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Mailman-Approved-At: Wed, 21 Dec 2011 20:39:05 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) `window-state-put' as used within the following functions does not work. Please see *Backtrace* below for error. (See also post to help-gnu-emacs@gnu.org with subject "Save and load window states") Steps to reproduce: 1) Start via `emacs -Q'. 2) evaluate the two functions: (defun my-save-frame () (interactive) (let ((buf (find-file-noselect "/tmp/emacs-layout"))) (set-buffer buf) (erase-buffer) (print (window-state-get) buf) (save-buffer) (kill-buffer))) (defun my-load-frame () (interactive) (let ((buf (find-file-noselect "/tmp/emacs-layout"))) (set-buffer buf) (beginning-of-buffer) (window-state-put (read buf)) (kill-buffer))) 3) Do a `M-x my-save-frame' and after that `M-x my-load-frame' Debugger entered--Lisp error: (invalid-read-syntax "#") read(#) (window-state-put (read buf)) (let ((buf (find-file-noselect "/tmp/emacs-layout"))) (set-buffer buf) (beginning-of-buffer) (window-state-put (read buf)) (save-buffer) (kill-buffer)) my-load-frame() call-interactively(my-load-frame t nil) execute-extended-command(nil) call-interactively(execute-extended-command nil nil) Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8 default enable-multibyte-characters: t Recent messages: Wrote /tmp/emacs-layout Quit Mark set window-state-put: Invalid read syntax: "#" From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Dec 2011 17:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Bach Cc: 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132457360023687 (code B ref 10348); Thu, 22 Dec 2011 17:07:01 +0000 Received: (at 10348) by debbugs.gnu.org; 22 Dec 2011 17:06:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rdm6K-00069z-0z for submit@debbugs.gnu.org; Thu, 22 Dec 2011 12:06:40 -0500 Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Rdm6G-00069q-Vc for 10348@debbugs.gnu.org; Thu, 22 Dec 2011 12:06:38 -0500 Received: (qmail invoked by alias); 22 Dec 2011 17:04:24 -0000 Received: from 62-47-47-194.adsl.highway.telekom.at (EHLO [62.47.47.194]) [62.47.47.194] by mail.gmx.net (mp024) with SMTP; 22 Dec 2011 18:04:24 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+W8CEm19eWmPXzM/1Z3IC5vP2j0DLbkuHHT16qj4 mp5C9VA7FZ+GWr Message-ID: <4EF36318.6000006@gmx.at> Date: Thu, 22 Dec 2011 18:04:24 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> In-Reply-To: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) > Steps to reproduce: > 1) Start via `emacs -Q'. > 2) evaluate the two functions: > (defun my-save-frame () > (interactive) > (let ((buf (find-file-noselect "/tmp/emacs-layout"))) > (set-buffer buf) > (erase-buffer) > (print (window-state-get) buf) > (save-buffer) > (kill-buffer))) > > (defun my-load-frame () > (interactive) > (let ((buf (find-file-noselect "/tmp/emacs-layout"))) > (set-buffer buf) > (beginning-of-buffer) > (window-state-put (read buf)) > (kill-buffer))) > > 3) Do a `M-x my-save-frame' and after that `M-x my-load-frame' > > Debugger entered--Lisp error: (invalid-read-syntax "#") > read(#) > (window-state-put (read buf)) > (let ((buf (find-file-noselect "/tmp/emacs-layout"))) (set-buffer buf) (beginning-of-buffer) (window-state-put (read buf)) (save-buffer) (kill-buffer)) > my-load-frame() > call-interactively(my-load-frame t nil) > execute-extended-command(nil) > call-interactively(execute-extended-command nil nil) FWIW, the behavior observed by Michael is caused by the presence of window objects in the `clone-of' parameters saved by `window-state-get'. I initially used the window number for this purpose but Stefan later told me that a user can store arbitrary objects without read syntax in window parameters so this would have just worked around the current problem but would not work in general. (The corresponding thread was at http://lists.gnu.org/archive/html/emacs-diffs/2011-06/msg00321.html but I have no idea how to retrieve it.) We have a variety of ways to deal with this: (1) Do not save the `clone-of' parameter. It's not yet useful anyway. This will not solve the more general problem mentioned above. (2) Do not save window parameters. While this should fix all problems in the context of this bug report, it will prevent us from saving and restoring information needed to make applications work that rely on window parameters. (3) Save only parameters whose value have a read syntax. This can be done either in `window-state-get' or in `my-save-frame'. (4) Convert parameter values to something with a read syntax. Basically this is what we already do with buffers (using the name of the buffer instead of the buffer object) and can be easily done with windows (save the window number instead of the window object). (5) Make functions like `my-load-frame' aware that components of saved window states might not have a read syntax and have them take the appropriate action. Unless you have a better suggestion I'll apply (1) for Emacs 24.1 and try to propose a combination of (3) and (4) for later releases. martin From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Dec 2011 17:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "'martin rudalics'" , "'Michael Bach'" Cc: 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132457418424540 (code B ref 10348); Thu, 22 Dec 2011 17:17:01 +0000 Received: (at 10348) by debbugs.gnu.org; 22 Dec 2011 17:16:24 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RdmFj-0006Nj-GF for submit@debbugs.gnu.org; Thu, 22 Dec 2011 12:16:23 -0500 Received: from acsinet15.oracle.com ([141.146.126.227]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RdmFi-0006Nd-7K for 10348@debbugs.gnu.org; Thu, 22 Dec 2011 12:16:22 -0500 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id pBMHE9GI027609 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 22 Dec 2011 17:14:10 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id pBMHE9mx008679 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Dec 2011 17:14:09 GMT Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id pBMHE8AM017532; Thu, 22 Dec 2011 11:14:08 -0600 Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 22 Dec 2011 09:14:08 -0800 From: "Drew Adams" References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> Date: Thu, 22 Dec 2011 09:14:07 -0800 Message-ID: <17AD1F44DBEE4AA3ACA07C1131008B2A@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <4EF36318.6000006@gmx.at> Thread-Index: AczAy9pI0CkGYeqtSNS1J/lS2ghSDQAAP4xQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090204.4EF36562.01C3,ss=1,re=0.000,fgs=0 X-Spam-Score: -6.2 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) > We have a variety of ways to deal with this: > > (1) Do not save the `clone-of' parameter. It's not yet useful anyway. > This will not solve the more general problem mentioned above. > > (2) Do not save window parameters. While this should fix all problems > in the context of this bug report, it will prevent us from saving > and restoring information needed to make applications > work that rely on window parameters. > > (3) Save only parameters whose value have a read syntax. This can be > done either in `window-state-get' or in `my-save-frame'. > > (4) Convert parameter values to something with a read syntax. > Basically > this is what we already do with buffers (using the name of the > buffer instead of the buffer object) and can be easily done with > windows (save the window number instead of the window object). > > (5) Make functions like `my-load-frame' aware that components of saved > window states might not have a read syntax and have them take the > appropriate action. > > Unless you have a better suggestion I'll apply (1) for Emacs 24.1 and > try to propose a combination of (3) and (4) for later releases. Perhaps another possibility? (6) Provide read syntax for all known parameter values. Just a thought - no idea whether it is a good idea. From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Dec 2011 22:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132459123517136 (code B ref 10348); Thu, 22 Dec 2011 22:01:02 +0000 Received: (at 10348) by debbugs.gnu.org; 22 Dec 2011 22:00:35 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rdqgk-0004SL-JK for submit@debbugs.gnu.org; Thu, 22 Dec 2011 17:00:35 -0500 Received: from smarty.dreamhost.com ([208.113.175.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rdqgi-0004SD-4I for 10348@debbugs.gnu.org; Thu, 22 Dec 2011 17:00:32 -0500 Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 535D4684086; Thu, 22 Dec 2011 13:58:19 -0800 (PST) Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id B6490451C6FE; Thu, 22 Dec 2011 13:57:45 -0800 (PST) From: Juri Linkov Organization: JURTA References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> Date: Thu, 22 Dec 2011 23:57:52 +0200 In-Reply-To: <4EF36318.6000006@gmx.at> (martin rudalics's message of "Thu, 22 Dec 2011 18:04:24 +0100") Message-ID: <87vcp846cf.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) > Unless you have a better suggestion I'll apply (1) for Emacs 24.1 and > try to propose a combination of (3) and (4) for later releases. (7) Save window ids as numbers for referencing them when reading, e.g. (... (hc ... (id 3) (parameters (clone-of . 7)) (leaf ... (id 7) (parameters (clone-of . 9)) (buffer "*scratch*" ...)) (vc (id 9) (parameters (clone-of . 3)) ... ))) From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: Juanma Barranquero Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Dec 2011 23:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: martin rudalics , 10348@debbugs.gnu.org, Michael Bach Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132459482922320 (code B ref 10348); Thu, 22 Dec 2011 23:01:01 +0000 Received: (at 10348) by debbugs.gnu.org; 22 Dec 2011 23:00:29 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rdrcj-0005nx-LV for submit@debbugs.gnu.org; Thu, 22 Dec 2011 18:00:29 -0500 Received: from mail-pw0-f44.google.com ([209.85.160.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rdrch-0005nn-9Y for 10348@debbugs.gnu.org; Thu, 22 Dec 2011 18:00:27 -0500 Received: by pbdd12 with SMTP id d12so5077779pbd.3 for <10348@debbugs.gnu.org>; Thu, 22 Dec 2011 14:58:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=0HzJDJreu99ycdqFJPvkscLZgR/4QMNBQzemedh3Dpw=; b=KMknAOXQ8EgR0/dGvwcbk1SkxcHRmV2Pjz5cHOk0zmd1zFgc4CIEb4twE7UEBj37wF 5XKgFdewAJD6/ooNqXz7SwS6iBYmVvMxDnFMLiObA6z1NXFpSZj62GXspVQErwFJzeQk TN0H9zuYToooWpvDlGOrt5JXUpXMHGnlXcL3M= Received: by 10.68.73.68 with SMTP id j4mr26211770pbv.40.1324594694202; Thu, 22 Dec 2011 14:58:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.247.28 with HTTP; Thu, 22 Dec 2011 14:57:33 -0800 (PST) In-Reply-To: <87vcp846cf.fsf@mail.jurta.org> References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <87vcp846cf.fsf@mail.jurta.org> From: Juanma Barranquero Date: Thu, 22 Dec 2011 23:57:33 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.4 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) > (7) Save window ids as numbers for referencing them when reading, e.g. This is a fix for this specific bug, as is Martin's proposal 1, which is also simpler. But that does not fix the general problem of window parameters containing objects with no read syntax. So Martin's 3, 4 or 5 is still needed (post 24.1). =C2=A0 =C2=A0 Juanma From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Dec 2011 23:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juanma Barranquero Cc: martin rudalics , 10348@debbugs.gnu.org, Michael Bach Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132459701725428 (code B ref 10348); Thu, 22 Dec 2011 23:37:02 +0000 Received: (at 10348) by debbugs.gnu.org; 22 Dec 2011 23:36:57 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RdsC0-0006c5-B8 for submit@debbugs.gnu.org; Thu, 22 Dec 2011 18:36:56 -0500 Received: from smarty.dreamhost.com ([208.113.175.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RdsBx-0006bx-JY for 10348@debbugs.gnu.org; Thu, 22 Dec 2011 18:36:55 -0500 Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 80FB0684065; Thu, 22 Dec 2011 15:34:40 -0800 (PST) Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 63934451C5A6; Thu, 22 Dec 2011 15:34:06 -0800 (PST) From: Juri Linkov Organization: JURTA References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <87vcp846cf.fsf@mail.jurta.org> Date: Fri, 23 Dec 2011 01:34:12 +0200 In-Reply-To: (Juanma Barranquero's message of "Thu, 22 Dec 2011 23:57:33 +0100") Message-ID: <87zkek2nbf.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) > But that does not fix the general problem of window parameters > containing objects with no read syntax. So Martin's 3, 4 or 5 is still > needed (post 24.1). For the general problem we could use something like `desktop-outvar' from desktop.el. From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Dec 2011 01:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.1324602321779 (code B ref 10348); Fri, 23 Dec 2011 01:06:01 +0000 Received: (at 10348) by debbugs.gnu.org; 23 Dec 2011 01:05:21 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RdtZZ-0000CW-1Y for submit@debbugs.gnu.org; Thu, 22 Dec 2011 20:05:21 -0500 Received: from smtp-04.vtx.ch ([194.38.175.93]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RdtZW-0000CO-RD for 10348@debbugs.gnu.org; Thu, 22 Dec 2011 20:05:20 -0500 Received: from ceviche.home (dyn.144-85-141-078.dsl.vtx.ch [144.85.141.78]) by smtp-04.vtx.ch (VTX Services SA) with ESMTP id 04E6A29B1E1; Fri, 23 Dec 2011 02:03:05 +0100 (CET) Received: by ceviche.home (Postfix, from userid 20848) id B3142660D5; Thu, 22 Dec 2011 20:03:04 -0500 (EST) From: Stefan Monnier Message-ID: References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> Date: Thu, 22 Dec 2011 20:03:04 -0500 In-Reply-To: <4EF36318.6000006@gmx.at> (martin rudalics's message of "Thu, 22 Dec 2011 18:04:24 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.4 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) > (1) Do not save the `clone-of' parameter. It's not yet useful anyway. > This will not solve the more general problem mentioned above. As mentioned, it's not a really convincing solution. > (2) Do not save window parameters. While this should fix all problems > in the context of this bug report, it will prevent us from saving > and restoring information needed to make applications work that rely > on window parameters. This is fairly attractive, tho a bit too radical. > (3) Save only parameters whose value have a read syntax. This can be > done either in `window-state-get' or in `my-save-frame'. This can make the save&restore work and fail in somewhat unpredictable ways. Too magical. > (4) Convert parameter values to something with a read syntax. Basically > this is what we already do with buffers (using the name of the > buffer instead of the buffer object) and can be easily done with > windows (save the window number instead of the window object). This would be a good change, especially if by "window number" you mean a number meaningful in an output file rather than only in the current session (see Juri's example) but it doesn't fix all cases. > (5) Make functions like `my-load-frame' aware that components of saved > window states might not have a read syntax and have them take the > appropriate action. This is like (3) except the magic is done elsewhere. > Unless you have a better suggestion I'll apply (1) for Emacs 24.1 and > try to propose a combination of (3) and (4) for later releases. I think the best course of action is to only save the window parameters listed in some variable (window-state-saved-parameters?). Adding some of (4) would be a good additional refinement. Actually, it might even be good to filter which params to keep not just when saving but already when constructing the window-state object (some params may simply not belong in a window-state object because restoring them would make no sense). After all the window-configurations don't save&restore window parameters. Stefan From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Dec 2011 10:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132463636417333 (code B ref 10348); Fri, 23 Dec 2011 10:33:02 +0000 Received: (at 10348) by debbugs.gnu.org; 23 Dec 2011 10:32:44 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Re2Qe-0004VW-Dy for submit@debbugs.gnu.org; Fri, 23 Dec 2011 05:32:44 -0500 Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Re2Qc-0004VO-7g for 10348@debbugs.gnu.org; Fri, 23 Dec 2011 05:32:43 -0500 Received: (qmail invoked by alias); 23 Dec 2011 10:30:22 -0000 Received: from 62-47-38-253.adsl.highway.telekom.at (EHLO [62.47.38.253]) [62.47.38.253] by mail.gmx.net (mp058) with SMTP; 23 Dec 2011 11:30:22 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/alAlutRPaAPtsXHh5Q+8eJVlTAzAteLma1b8mp4 5palNvgoN2sPPm Message-ID: <4EF4583E.2070307@gmx.at> Date: Fri, 23 Dec 2011 11:30:22 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <87vcp846cf.fsf@mail.jurta.org> In-Reply-To: <87vcp846cf.fsf@mail.jurta.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) > (7) Save window ids as numbers for referencing them when reading, e.g. > > (... > (hc > ... > (id 3) > (parameters > (clone-of . 7)) I did something like that in revision #104759. Note, however, that numbers work reliably only when using `window-state-put' in one and the same session as the corresponding `window-state-get'. It would be rather difficult to make them work across sessions. martin From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Dec 2011 10:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: Juanma Barranquero , 10348@debbugs.gnu.org, Michael Bach Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132463637517355 (code B ref 10348); Fri, 23 Dec 2011 10:33:02 +0000 Received: (at 10348) by debbugs.gnu.org; 23 Dec 2011 10:32:55 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Re2Qo-0004Vr-SD for submit@debbugs.gnu.org; Fri, 23 Dec 2011 05:32:55 -0500 Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Re2Qn-0004Vl-EQ for 10348@debbugs.gnu.org; Fri, 23 Dec 2011 05:32:54 -0500 Received: (qmail invoked by alias); 23 Dec 2011 10:30:37 -0000 Received: from 62-47-38-253.adsl.highway.telekom.at (EHLO [62.47.38.253]) [62.47.38.253] by mail.gmx.net (mp024) with SMTP; 23 Dec 2011 11:30:37 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX184sPcXUCI4iIfdHu+02Py7HHLlMIog9VoUVE5CrM jnRpEsULskdjnQ Message-ID: <4EF4584C.2040200@gmx.at> Date: Fri, 23 Dec 2011 11:30:36 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <87vcp846cf.fsf@mail.jurta.org> <87zkek2nbf.fsf@mail.jurta.org> In-Reply-To: <87zkek2nbf.fsf@mail.jurta.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) > For the general problem we could use something like `desktop-outvar' > from desktop.el. Looks like Drew is already investigating `desktop-internal-v2s' ;-) martin From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Dec 2011 10:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132463643617463 (code B ref 10348); Fri, 23 Dec 2011 10:34:01 +0000 Received: (at 10348) by debbugs.gnu.org; 23 Dec 2011 10:33:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Re2Ro-0004Xc-9G for submit@debbugs.gnu.org; Fri, 23 Dec 2011 05:33:56 -0500 Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Re2Rl-0004XS-Iv for 10348@debbugs.gnu.org; Fri, 23 Dec 2011 05:33:54 -0500 Received: (qmail invoked by alias); 23 Dec 2011 10:31:37 -0000 Received: from 62-47-38-253.adsl.highway.telekom.at (EHLO [62.47.38.253]) [62.47.38.253] by mail.gmx.net (mp007) with SMTP; 23 Dec 2011 11:31:37 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+wIZA/vFywpYurUa/yheZHNGtn8GYEsoDIIAAUmL jLhoAPCml/flRj Message-ID: <4EF45888.3030204@gmx.at> Date: Fri, 23 Dec 2011 11:31:36 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) >> (1) Do not save the `clone-of' parameter. It's not yet useful anyway. >> This will not solve the more general problem mentioned above. > > As mentioned, it's not a really convincing solution. It would allow us to silently ignore this problem until 24.2. And it would obviously allow Michael to go on with his work. His feedback would be overly welcome here. >> (3) Save only parameters whose value have a read syntax. This can be >> done either in `window-state-get' or in `my-save-frame'. > > This can make the save&restore work and fail in somewhat > unpredictable ways. Too magical. IIUC this is what desktop does. The problem is rather that we would have to distinguish between values needed for intra-session purposes and those that make sense for inter-session purposes too. >> (4) Convert parameter values to something with a read syntax. Basically >> this is what we already do with buffers (using the name of the >> buffer instead of the buffer object) and can be easily done with >> windows (save the window number instead of the window object). > > This would be a good change, especially if by "window number" you mean > a number meaningful in an output file rather than only in the current > session (see Juri's example) ... exactly (and that won't be easy since `window-state-put' could be called at any time in a new session and not only before the first window is created in that session). > but it doesn't fix all cases. I'm afraid so. >> (5) Make functions like `my-load-frame' aware that components of saved >> window states might not have a read syntax and have them take the >> appropriate action. > > This is like (3) except the magic is done elsewhere. Yes. Just that (3) seems better. >> Unless you have a better suggestion I'll apply (1) for Emacs 24.1 and >> try to propose a combination of (3) and (4) for later releases. > > I think the best course of action is to only save the window > parameters listed in some variable (window-state-saved-parameters?). You mean that anyone who misuses that variable (by including, for example, a parameter that actually stores a window object as value) would be on her own? Doesn't look so attractive to me since the effect will only be seen in a new session, some time after the problematic save happened. > Adding some of (4) would be a good additional refinement. If it can be reasonably done. > Actually, it might even be good to filter which params to keep not just > when saving but already when constructing the window-state object (some > params may simply not belong in a window-state object because restoring > them would make no sense). Agreed. > After all the window-configurations don't > save&restore window parameters. Currently they do (unless you modify them destructively). Otherwise, side windows and atomic windows won't work. martin From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: Michael Bach Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Dec 2011 11:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: 10348@debbugs.gnu.org, Stefan Monnier Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132463970022252 (code B ref 10348); Fri, 23 Dec 2011 11:29:01 +0000 Received: (at 10348) by debbugs.gnu.org; 23 Dec 2011 11:28:20 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Re3IS-0005mq-3J for submit@debbugs.gnu.org; Fri, 23 Dec 2011 06:28:20 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Re3IP-0005mi-RH for 10348@debbugs.gnu.org; Fri, 23 Dec 2011 06:28:18 -0500 Received: by eekc14 with SMTP id c14so9059422eek.3 for <10348@debbugs.gnu.org>; Fri, 23 Dec 2011 03:26:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=G4Kc3k/EVrNnSER4KwjLSbZ+AopuALQrKfVTOWlIO6k=; b=ZGM+hMgIqjajq75652klWsaWN+5OHzAas5aDlaITaND5wbP2S5P8FoYHlLtqa57+yt hEm4dS5OuHzAGnianVNlTxuRMYUBllVLUY7m26Kxqwbt4YFnA7KsL3n4tusAezytVNJz slqYpK0SDTdwsiVZBldjPKkaHTsJvQRAsa2Oc= Received: by 10.14.3.232 with SMTP id 80mr5809378eeh.2.1324639562073; Fri, 23 Dec 2011 03:26:02 -0800 (PST) Received: from voschtro (p5795C9F3.dip.t-dialin.net. [87.149.201.243]) by mx.google.com with ESMTPS id s16sm47138868eef.2.2011.12.23.03.26.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Dec 2011 03:26:01 -0800 (PST) From: Michael Bach References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> Date: Fri, 23 Dec 2011 12:30:03 +0100 In-Reply-To: <4EF45888.3030204@gmx.at> (martin rudalics's message of "Fri, 23 Dec 2011 11:31:36 +0100") Message-ID: <4ef46549.10610e0a.01e0.1d64@mx.google.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.6 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.6 (---) martin rudalics writes: >>> (1) Do not save the `clone-of' parameter. It's not yet useful anyway. >>> This will not solve the more general problem mentioned above. >> >> As mentioned, it's not a really convincing solution. > > It would allow us to silently ignore this problem until 24.2. And it > would obviously allow Michael to go on with his work. His feedback > would be overly welcome here. > As far as I am concerned, the issue is resolved thanks to Martin's prompt and competent answers on the emacs help list. For me, this bug can be marked as fixed. Michael From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Dec 2011 15:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "'martin rudalics'" , "'Juri Linkov'" Cc: 'Juanma Barranquero' , 10348@debbugs.gnu.org, 'Michael Bach' Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132465320112533 (code B ref 10348); Fri, 23 Dec 2011 15:14:01 +0000 Received: (at 10348) by debbugs.gnu.org; 23 Dec 2011 15:13:21 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Re6oD-0003G6-5w for submit@debbugs.gnu.org; Fri, 23 Dec 2011 10:13:21 -0500 Received: from rcsinet15.oracle.com ([148.87.113.117]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Re6oA-0003Fy-SQ for 10348@debbugs.gnu.org; Fri, 23 Dec 2011 10:13:19 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id pBNFB13N013893 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 23 Dec 2011 15:11:02 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id pBNFB0v1022424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 Dec 2011 15:11:00 GMT Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id pBNFB0jZ004132; Fri, 23 Dec 2011 09:11:00 -0600 Received: from dradamslap1 (/10.159.48.116) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 23 Dec 2011 07:11:00 -0800 From: "Drew Adams" References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at><87vcp846cf.fsf@mail.jurta.org> <87zkek2nbf.fsf@mail.jurta.org> <4EF4584C.2040200@gmx.at> Date: Fri, 23 Dec 2011 07:10:56 -0800 Message-ID: <08BB8662CBE7472D9FF391E52F609186@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <4EF4584C.2040200@gmx.at> Thread-Index: AczBXftZJ41norqtTIi0ICLN+t2I2QAJl9lA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090203.4EF49A06.004A,ss=1,re=0.000,fgs=0 X-Spam-Score: -6.2 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) > > For the general problem we could use something like > > `desktop-outvar' from desktop.el. > > Looks like Drew is already investigating `desktop-internal-v2s' ;-) ;-) Not really - just looked it over. But I do save things on my own and wanted to see if there was now a conventional serialization route. FWIW, maybe like something general like that should be autoloadable or, better perhaps, somewhere other than desktop.el? Just a thought - why need to load desktop.el if you are not necessarily interested in saving/restoring desktops and you just want to serialize something? From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Dec 2011 21:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: Michael Bach , Stefan Monnier , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132467716017742 (code B ref 10348); Fri, 23 Dec 2011 21:53:02 +0000 Received: (at 10348) by debbugs.gnu.org; 23 Dec 2011 21:52:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ReD2d-0004c6-MO for submit@debbugs.gnu.org; Fri, 23 Dec 2011 16:52:40 -0500 Received: from smarty.dreamhost.com ([208.113.175.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ReD2R-0004bk-Ey for 10348@debbugs.gnu.org; Fri, 23 Dec 2011 16:52:28 -0500 Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 8DAD7684074; Fri, 23 Dec 2011 13:50:09 -0800 (PST) Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id A37A3451C700; Fri, 23 Dec 2011 13:49:34 -0800 (PST) From: Juri Linkov Organization: JURTA References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> Date: Fri, 23 Dec 2011 23:14:17 +0200 In-Reply-To: <4EF45888.3030204@gmx.at> (martin rudalics's message of "Fri, 23 Dec 2011 11:31:36 +0100") Message-ID: <871urvarpo.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) >>> (3) Save only parameters whose value have a read syntax. This can be >>> done either in `window-state-get' or in `my-save-frame'. >> >> This can make the save&restore work and fail in somewhat >> unpredictable ways. Too magical. > > IIUC this is what desktop does. The problem is rather that we would > have to distinguish between values needed for intra-session purposes and > those that make sense for inter-session purposes too. Actually there exists already a parameter that distinguishes between values needed for intra-session purposes and needed for inter-session purposes. It is the argument `markers' of the function `window-state-get'. When non-nil, it returns internal values meaningful only in the current session. When nil, it returns integer values safe to save and read in another session. This argument could be renamed to a more general name and used for other values besides markers. Then a caller of `window-state-get' could decide whether its return value is intended for the same session or for intra-session purposes. From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Dec 2011 00:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132468536629465 (code B ref 10348); Sat, 24 Dec 2011 00:10:01 +0000 Received: (at 10348) by debbugs.gnu.org; 24 Dec 2011 00:09:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ReFB0-0007fC-3R for submit@debbugs.gnu.org; Fri, 23 Dec 2011 19:09:26 -0500 Received: from smtp-02.vtx.ch ([194.38.175.91]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ReFAx-0007f2-9Y for 10348@debbugs.gnu.org; Fri, 23 Dec 2011 19:09:24 -0500 Received: from ceviche.home (dyn.144-85-182-057.dsl.vtx.ch [144.85.182.57]) by smtp-02.vtx.ch (VTX Services SA) with ESMTP id DE12A607E8; Sat, 24 Dec 2011 01:07:03 +0100 (CET) Received: by ceviche.home (Postfix, from userid 20848) id 91A23660D4; Fri, 23 Dec 2011 19:07:01 -0500 (EST) From: Stefan Monnier Message-ID: References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> Date: Fri, 23 Dec 2011 19:07:01 -0500 In-Reply-To: <4EF45888.3030204@gmx.at> (martin rudalics's message of "Fri, 23 Dec 2011 11:31:36 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.4 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) >>> (1) Do not save the `clone-of' parameter. It's not yet useful anyway. >>> This will not solve the more general problem mentioned above. >> As mentioned, it's not a really convincing solution. > It would allow us to silently ignore this problem until 24.2. And it > would obviously allow Michael to go on with his work. His feedback > would be overly welcome here. No, it would address this particular bug-report, but similar problems may reappear at any time. > IIUC this is what desktop does. The problem is rather that we would > have to distinguish between values needed for intra-session purposes and > those that make sense for inter-session purposes too. I'm not sure distinguishing the two is needed (especially for window-state-*). >>> Unless you have a better suggestion I'll apply (1) for Emacs 24.1 and >>> try to propose a combination of (3) and (4) for later releases. >> I think the best course of action is to only save the window >> parameters listed in some variable (window-state-saved-parameters?). > You mean that anyone who misuses that variable (by including, for > example, a parameter that actually stores a window object as value) > would be on her own? I don't see any harm in it. > Doesn't look so attractive to me since the effect will only be seen in > a new session, some time after the problematic save happened. Not if we make this variable specify which parameters to include in window-states, rather than only which parameters to write to a file. Or maybe I don't understand the problem you're referring to. >> Actually, it might even be good to filter which params to keep not just >> when saving but already when constructing the window-state object (some >> params may simply not belong in a window-state object because restoring >> them would make no sense). > Agreed. >> After all the window-configurations don't save&restore >> window parameters. > Currently they do (unless you modify them destructively). Otherwise, > side windows and atomic windows won't work. Oh, I see that's another change in Emacs-24. It's actually problematic because set-window-parameter does operate destructively, so it makes the semantics rather irregular. Stefan From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Dec 2011 09:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: Michael Bach , Stefan Monnier , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132471894713353 (code B ref 10348); Sat, 24 Dec 2011 09:30:02 +0000 Received: (at 10348) by debbugs.gnu.org; 24 Dec 2011 09:29:07 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ReNuc-0003TK-Th for submit@debbugs.gnu.org; Sat, 24 Dec 2011 04:29:07 -0500 Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1ReNua-0003TD-Ux for 10348@debbugs.gnu.org; Sat, 24 Dec 2011 04:29:05 -0500 Received: (qmail invoked by alias); 24 Dec 2011 09:26:43 -0000 Received: from 62-47-32-189.adsl.highway.telekom.at (EHLO [62.47.32.189]) [62.47.32.189] by mail.gmx.net (mp008) with SMTP; 24 Dec 2011 10:26:43 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19kBRVfDpNk8SIP1MxRXh/nG1gTLA+BvwvKXPJ7Ra 08ZkyiDuIK76zt Message-ID: <4EF59AD1.5060003@gmx.at> Date: Sat, 24 Dec 2011 10:26:41 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> <871urvarpo.fsf@mail.jurta.org> In-Reply-To: <871urvarpo.fsf@mail.jurta.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) > Actually there exists already a parameter that distinguishes between values > needed for intra-session purposes and needed for inter-session purposes. > It is the argument `markers' of the function `window-state-get'. When non-nil, > it returns internal values meaningful only in the current session. When nil, > it returns integer values safe to save and read in another session. > This argument could be renamed to a more general name and used for > other values besides markers. Then a caller of `window-state-get' > could decide whether its return value is intended for the same session > or for intra-session purposes. So we could add the `window-state-saved-parameters' variable Stefan proposed and add parameters mentioned there only if the (probably) renamed MARKERS argument is t or nil (whatever default we want here). martin From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Dec 2011 09:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132471899513412 (code B ref 10348); Sat, 24 Dec 2011 09:30:03 +0000 Received: (at 10348) by debbugs.gnu.org; 24 Dec 2011 09:29:55 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ReNvP-0003UH-4j for submit@debbugs.gnu.org; Sat, 24 Dec 2011 04:29:55 -0500 Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1ReNvN-0003U9-5n for 10348@debbugs.gnu.org; Sat, 24 Dec 2011 04:29:53 -0500 Received: (qmail invoked by alias); 24 Dec 2011 09:27:31 -0000 Received: from 62-47-32-189.adsl.highway.telekom.at (EHLO [62.47.32.189]) [62.47.32.189] by mail.gmx.net (mp031) with SMTP; 24 Dec 2011 10:27:31 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/3+A4y/vT3CE8x/t0Wl6M4lDRBDlqMTdulpvGfdG cUUQ4cU1GZ3DER Message-ID: <4EF59B02.9060608@gmx.at> Date: Sat, 24 Dec 2011 10:27:30 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) > No, it would address this particular bug-report, but similar problems > may reappear at any time. Yes. Someone could do (set-window-dedicated-p nil (selected-window)). >> IIUC this is what desktop does. The problem is rather that we would >> have to distinguish between values needed for intra-session purposes and >> those that make sense for inter-session purposes too. > > I'm not sure distinguishing the two is needed (especially for > window-state-*). So your proposed `window-state-saved-parameters' would never save and restore a thing like the "clone-of" parameter? >> You mean that anyone who misuses that variable (by including, for >> example, a parameter that actually stores a window object as value) >> would be on her own? > > I don't see any harm in it. Any application setting a window parameter to some non-standard value would be held responsible for this. Fine with me, but ... >> Doesn't look so attractive to me since the effect will only be seen in >> a new session, some time after the problematic save happened. > > Not if we make this variable specify which parameters to include in > window-states, rather than only which parameters to write to a file. > Or maybe I don't understand the problem you're referring to. The window-state-* functions are primarily intended for inter-session use. So if we can save a bad value, the bug will be usually detected when it's too late. >>> After all the window-configurations don't save&restore >>> window parameters. >> Currently they do (unless you modify them destructively). Otherwise, >> side windows and atomic windows won't work. > > Oh, I see that's another change in Emacs-24. It's actually problematic > because set-window-parameter does operate destructively, `set-window-parameter' is harmless. The problem occurs only if you modify a window parameter's value destructively. > so it makes the > semantics rather irregular. It's precisely the same as for the dedicated status of a window. martin From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Dec 2011 19:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Drew Adams" Cc: 'martin rudalics' , 10348@debbugs.gnu.org, 'Michael Bach' , 'Juanma Barranquero' Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132475377110636 (code B ref 10348); Sat, 24 Dec 2011 19:10:01 +0000 Received: (at 10348) by debbugs.gnu.org; 24 Dec 2011 19:09:31 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ReWyJ-0002lU-2P for submit@debbugs.gnu.org; Sat, 24 Dec 2011 14:09:31 -0500 Received: from smarty.dreamhost.com ([208.113.175.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ReWyH-0002lM-JG for 10348@debbugs.gnu.org; Sat, 24 Dec 2011 14:09:30 -0500 Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 61D7668405D; Sat, 24 Dec 2011 11:07:06 -0800 (PST) Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 6B384451C680; Sat, 24 Dec 2011 11:06:30 -0800 (PST) From: Juri Linkov Organization: JURTA References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <87vcp846cf.fsf@mail.jurta.org> <87zkek2nbf.fsf@mail.jurta.org> <4EF4584C.2040200@gmx.at> <08BB8662CBE7472D9FF391E52F609186@us.oracle.com> Date: Sat, 24 Dec 2011 21:04:23 +0200 In-Reply-To: <08BB8662CBE7472D9FF391E52F609186@us.oracle.com> (Drew Adams's message of "Fri, 23 Dec 2011 07:10:56 -0800") Message-ID: <8762h5okp4.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) > FWIW, maybe like something general like that should be autoloadable or, better > perhaps, somewhere other than desktop.el? Just a thought - why need to load > desktop.el if you are not necessarily interested in saving/restoring desktops > and you just want to serialize something? It is tied to desktop functionality. For example, see how it serializes markers, and delays restoration of their values in `desktop-delay-hook' until the desktop is completely loaded: (desktop-value-to-string (window-state-get nil t)) => (list '((min-height . 4) (min-width . 10) (min-height-ignore . 2) (min-width-ignore . 9) (min-height-safe . 1) (min-width-safe . 2)) 'leaf '(total-height . 61) '(total-width . 227) '(normal-height . 1.0) '(normal-width . 1.0) '(combination-limit) '(parameters (clone-of . "Unprintable entity")) (list 'buffer "*scratch*" '(selected . t) '(hscroll . 0) '(fringes 9 9 nil) '(margins nil) '(scroll-bars 16 3 t nil) '(vscroll . 0) '(dedicated) (desktop-list* 'point (let ((mk (make-marker))) (add-hook 'desktop-delay-hook (list 'lambda '() (list 'set-marker mk 243 (get-buffer "*scratch*")))) mk)) (desktop-list* 'start (let ((mk (make-marker))) (add-hook 'desktop-delay-hook (list 'lambda '() (list 'set-marker mk 1 (get-buffer "*scratch*")))) mk)) (desktop-list* 'mark (let ((mk (make-marker))) (add-hook 'desktop-delay-hook (list 'lambda '() (list 'set-marker mk 192 (get-buffer "*scratch*")))) mk)))) From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Dec 2011 19:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: Michael Bach , Stefan Monnier , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132475389610821 (code B ref 10348); Sat, 24 Dec 2011 19:12:01 +0000 Received: (at 10348) by debbugs.gnu.org; 24 Dec 2011 19:11:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ReX0K-0002oU-Dj for submit@debbugs.gnu.org; Sat, 24 Dec 2011 14:11:36 -0500 Received: from smarty.dreamhost.com ([208.113.175.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ReX0I-0002oN-GL for 10348@debbugs.gnu.org; Sat, 24 Dec 2011 14:11:35 -0500 Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 88D47684067; Sat, 24 Dec 2011 11:09:11 -0800 (PST) Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 01930451C680; Sat, 24 Dec 2011 11:08:35 -0800 (PST) From: Juri Linkov Organization: JURTA References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> <871urvarpo.fsf@mail.jurta.org> <4EF59AD1.5060003@gmx.at> Date: Sat, 24 Dec 2011 21:08:02 +0200 In-Reply-To: <4EF59AD1.5060003@gmx.at> (martin rudalics's message of "Sat, 24 Dec 2011 10:26:41 +0100") Message-ID: <8739c9okjb.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) > So we could add the `window-state-saved-parameters' variable Stefan > proposed and add parameters mentioned there only if the (probably) > renamed MARKERS argument is t or nil (whatever default we want here). And (4) converting parameter values to something with a read syntax looks promising as well. We could reuse `desktop-value-to-string' and additionally serialize window ids as numbers to handle cases like when someone does (set-window-dedicated-p nil (selected-window)) From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Dec 2011 19:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132475444111606 (code B ref 10348); Sat, 24 Dec 2011 19:21:02 +0000 Received: (at 10348) by debbugs.gnu.org; 24 Dec 2011 19:20:41 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ReX97-000318-7D for submit@debbugs.gnu.org; Sat, 24 Dec 2011 14:20:41 -0500 Received: from smarty.dreamhost.com ([208.113.175.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ReX95-000311-42 for 10348@debbugs.gnu.org; Sat, 24 Dec 2011 14:20:39 -0500 Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id EB45568406A for <10348@debbugs.gnu.org>; Sat, 24 Dec 2011 11:18:15 -0800 (PST) Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id AB839451C680 for <10348@debbugs.gnu.org>; Sat, 24 Dec 2011 11:17:40 -0800 (PST) From: Juri Linkov Organization: JURTA References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> Date: Sat, 24 Dec 2011 21:17:19 +0200 In-Reply-To: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> (Michael Bach's message of "Wed, 21 Dec 2011 21:41:05 +0100") Message-ID: <87zkehn5j4.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) > Debugger entered--Lisp error: (invalid-read-syntax "#") There was another error in `window--state-get-1': (setq mark-even-if-inactive nil) (window-state-get) Debugger entered--Lisp error: (mark-inactive) signal(mark-inactive nil) mark() window--state-get-1(# nil) window-state-get() eval((window-state-get) nil) eval-last-sexp-1(nil) eval-last-sexp(nil) call-interactively(eval-last-sexp nil nil) That's because `(mark)' should be used with the `t' arg as `(mark t)'. I installed the fix. From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Dec 2011 11:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132481101428690 (code B ref 10348); Sun, 25 Dec 2011 11:04:02 +0000 Received: (at 10348) by debbugs.gnu.org; 25 Dec 2011 11:03:34 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Relra-0007Sg-HR for submit@debbugs.gnu.org; Sun, 25 Dec 2011 06:03:34 -0500 Received: from smtp-02.vtx.ch ([194.38.175.91]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RelrK-0007SK-V6 for 10348@debbugs.gnu.org; Sun, 25 Dec 2011 06:03:32 -0500 Received: from ceviche.home (dyn.144-85-136-084.dsl.vtx.ch [144.85.136.84]) by smtp-02.vtx.ch (VTX Services SA) with ESMTP id AF5E560814; Sun, 25 Dec 2011 12:00:51 +0100 (CET) Received: by ceviche.home (Postfix, from userid 20848) id 772D6660D4; Sun, 25 Dec 2011 06:00:49 -0500 (EST) From: Stefan Monnier Message-ID: References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> <4EF59B02.9060608@gmx.at> Date: Sun, 25 Dec 2011 06:00:49 -0500 In-Reply-To: <4EF59B02.9060608@gmx.at> (martin rudalics's message of "Sat, 24 Dec 2011 10:27:30 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.3 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.3 (---) >> No, it would address this particular bug-report, but similar problems >> may reappear at any time. > Yes. Someone could do (set-window-dedicated-p nil (selected-window)). Yup. >>> IIUC this is what desktop does. The problem is rather that we would >>> have to distinguish between values needed for intra-session purposes and >>> those that make sense for inter-session purposes too. >> I'm not sure distinguishing the two is needed (especially for >> window-state-*). > So your proposed `window-state-saved-parameters' would never save and > restore a thing like the "clone-of" parameter? Not quite "never", but at least not before we manage to serialize its value. >>> You mean that anyone who misuses that variable (by including, for >>> example, a parameter that actually stores a window object as value) >>> would be on her own? >> I don't see any harm in it. > Any application setting a window parameter to some non-standard value > would be held responsible for this. That's right. We should probably try to make the code a bit more robust so that the "invalid read syntax" error gets turned into a warning. >> Not if we make this variable specify which parameters to include in >> window-states, rather than only which parameters to write to a file. >> Or maybe I don't understand the problem you're referring to. > The window-state-* functions are primarily intended for inter-session > use. So if we can save a bad value, the bug will be usually detected > when it's too late. I can't see any scenario where such errors could really be detected earlier. >>>> After all the window-configurations don't save&restore >>>> window parameters. >>> Currently they do (unless you modify them destructively). Otherwise, >>> side windows and atomic windows won't work. >> Oh, I see that's another change in Emacs-24. It's actually problematic >> because set-window-parameter does operate destructively, > `set-window-parameter' is harmless. The problem occurs only if you > modify a window parameter's value destructively. I must be missing something: set-window-parameter does "modify a window parameter's value destructively". >> so it makes the semantics rather irregular. > It's precisely the same as for the dedicated status of a window. Is it? The irregularity I'm referring to, is that set-window-configuration will remove parameters that were added since the save, but will not undo the changes to the parameters that were modified since the save. Stefan From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Dec 2011 14:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: Michael Bach , Stefan Monnier , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132482160914415 (code B ref 10348); Sun, 25 Dec 2011 14:01:02 +0000 Received: (at 10348) by debbugs.gnu.org; 25 Dec 2011 14:00:09 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ReocT-0003kR-0u for submit@debbugs.gnu.org; Sun, 25 Dec 2011 09:00:09 -0500 Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1ReocQ-0003jy-Sd for 10348@debbugs.gnu.org; Sun, 25 Dec 2011 09:00:07 -0500 Received: (qmail invoked by alias); 25 Dec 2011 13:57:38 -0000 Received: from 62-47-56-242.adsl.highway.telekom.at (EHLO [62.47.56.242]) [62.47.56.242] by mail.gmx.net (mp024) with SMTP; 25 Dec 2011 14:57:38 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19+9TlQWVt+ZcF1xdJGylyIo43gvU1OC3wvsTl7H8 sf06TNKUrrx15w Message-ID: <4EF72BD0.8040801@gmx.at> Date: Sun, 25 Dec 2011 14:57:36 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> <871urvarpo.fsf@mail.jurta.org> <4EF59AD1.5060003@gmx.at> <8739c9okjb.fsf@mail.jurta.org> In-Reply-To: <8739c9okjb.fsf@mail.jurta.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) > And (4) converting parameter values to something with a read syntax > looks promising as well. We could reuse `desktop-value-to-string' > and additionally serialize window ids as numbers to handle cases like > when someone does (set-window-dedicated-p nil (selected-window)) Just that window numbers from a previous session won't be necessarily meaningful in the present session. So we either have to make such window numbers very complex to rule out any misinterpretations or allow only references to windows of the saved frame. martin From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Dec 2011 14:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132482163314453 (code B ref 10348); Sun, 25 Dec 2011 14:01:02 +0000 Received: (at 10348) by debbugs.gnu.org; 25 Dec 2011 14:00:33 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Reocr-0003l4-Dh for submit@debbugs.gnu.org; Sun, 25 Dec 2011 09:00:33 -0500 Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Reocp-0003kx-1k for 10348@debbugs.gnu.org; Sun, 25 Dec 2011 09:00:31 -0500 Received: (qmail invoked by alias); 25 Dec 2011 13:58:02 -0000 Received: from 62-47-56-242.adsl.highway.telekom.at (EHLO [62.47.56.242]) [62.47.56.242] by mail.gmx.net (mp067) with SMTP; 25 Dec 2011 14:58:02 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19I7bZ5UQxIcT95ifQq38Rh4pZ1EAbLqr/mF4JnFl 8m4V5xHOqJyMg9 Message-ID: <4EF72BE9.60604@gmx.at> Date: Sun, 25 Dec 2011 14:58:01 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> <4EF59B02.9060608@gmx.at> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) > I must be missing something: set-window-parameter does "modify a window > parameter's value destructively". > >>> so it makes the semantics rather irregular. >> It's precisely the same as for the dedicated status of a window. > > Is it? > The irregularity I'm referring to, is that set-window-configuration will > remove parameters that were added since the save, but will not undo the > changes to the parameters that were modified since the save. You're right. This makes window parameters useless for applications where a window excursion can temporarily store some other value for that parameter. In particular, side windows can be broken very easily. So we'd either have to copy the parameter list when creating a window configuration, not use `setcdr' in `set-window-parameter', or make a new slot for parameters that must not be modified destructively. Neither solution seems attractive to me. martin From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Dec 2011 21:58:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: Michael Bach , Stefan Monnier , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132485026322752 (code B ref 10348); Sun, 25 Dec 2011 21:58:03 +0000 Received: (at 10348) by debbugs.gnu.org; 25 Dec 2011 21:57:43 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rew4d-0005uu-7Y for submit@debbugs.gnu.org; Sun, 25 Dec 2011 16:57:43 -0500 Received: from smarty.dreamhost.com ([208.113.175.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rew4b-0005ug-BK for 10348@debbugs.gnu.org; Sun, 25 Dec 2011 16:57:41 -0500 Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 08A6A68406D; Sun, 25 Dec 2011 13:55:12 -0800 (PST) Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 5FB12451C686; Sun, 25 Dec 2011 13:54:35 -0800 (PST) From: Juri Linkov Organization: JURTA References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> <4EF59B02.9060608@gmx.at> <4EF72BE9.60604@gmx.at> Date: Sun, 25 Dec 2011 23:36:07 +0200 In-Reply-To: <4EF72BE9.60604@gmx.at> (martin rudalics's message of "Sun, 25 Dec 2011 14:58:01 +0100") Message-ID: <87wr9kuyew.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) > So we'd either have to copy the parameter list when creating a window > configuration, not use `setcdr' in `set-window-parameter', or make a new > slot for parameters that must not be modified destructively. Neither > solution seems attractive to me. Or to implement window-local variables like buffer-local variables. From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Dec 2011 00:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.13248591252817 (code B ref 10348); Mon, 26 Dec 2011 00:26:02 +0000 Received: (at 10348) by debbugs.gnu.org; 26 Dec 2011 00:25:25 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ReyNY-0000jO-QU for submit@debbugs.gnu.org; Sun, 25 Dec 2011 19:25:25 -0500 Received: from smtp-01.vtx.ch ([194.38.175.90]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ReyNU-0000jE-Q9 for 10348@debbugs.gnu.org; Sun, 25 Dec 2011 19:25:21 -0500 Received: from ceviche.home (dyn.83-228-148-093.dsl.vtx.ch [83.228.148.93]) by smtp-01.vtx.ch (VTX Services SA) with ESMTP id 3A31628772; Mon, 26 Dec 2011 01:22:50 +0100 (CET) Received: by ceviche.home (Postfix, from userid 20848) id 29B18663E1; Sun, 25 Dec 2011 19:22:49 -0500 (EST) From: Stefan Monnier Message-ID: References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> <4EF59B02.9060608@gmx.at> <4EF72BE9.60604@gmx.at> Date: Sun, 25 Dec 2011 19:22:49 -0500 In-Reply-To: <4EF72BE9.60604@gmx.at> (martin rudalics's message of "Sun, 25 Dec 2011 14:58:01 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.6 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.6 (---) > So we'd either have to copy the parameter list when creating a window > configuration, not use `setcdr' in `set-window-parameter', or make a new > slot for parameters that must not be modified destructively. Neither > solution seems attractive to me. Copying the alist seems perfectly fine to me. This said, while we're copying, we may as well filter at the same time: Emacs-23 did not preserve parameters, so rather than preserving them all, we could make Emacs-24 preserve only those params mentioned in a new var `window-configuration-saved-parameters'. For all I know, this new var might even be shared with `window-state-saved-parameters'. Stefan From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Dec 2011 11:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.13248978162901 (code B ref 10348); Mon, 26 Dec 2011 11:11:01 +0000 Received: (at 10348) by debbugs.gnu.org; 26 Dec 2011 11:10:16 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rf8Rc-0000ki-7R for submit@debbugs.gnu.org; Mon, 26 Dec 2011 06:10:16 -0500 Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Rf8RZ-0000kZ-Ms for 10348@debbugs.gnu.org; Mon, 26 Dec 2011 06:10:14 -0500 Received: (qmail invoked by alias); 26 Dec 2011 11:07:39 -0000 Received: from 62-47-52-66.adsl.highway.telekom.at (EHLO [62.47.52.66]) [62.47.52.66] by mail.gmx.net (mp033) with SMTP; 26 Dec 2011 12:07:39 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19t5KMe1uttGEqnAVi5HosyKfAcfchpkkd0F53EQQ TXfgTZyAg+7xp7 Message-ID: <4EF8557A.3020001@gmx.at> Date: Mon, 26 Dec 2011 12:07:38 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> <4EF59B02.9060608@gmx.at> <4EF72BE9.60604@gmx.at> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) > Copying the alist seems perfectly fine to me. This said, while we're > copying, we may as well filter at the same time: Emacs-23 did not > preserve parameters, so rather than preserving them all, we could make > Emacs-24 preserve only those params mentioned in a new var > `window-configuration-saved-parameters'. For all I know, this new var > might even be shared with `window-state-saved-parameters'. Suppose a window has a parameter which is not listed by that variable. Shall `set-window-configuration' (implicitly) remove that parameter from that window's parameters or keep it with its last value? martin From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Dec 2011 11:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: Michael Bach , Stefan Monnier , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.13248978202916 (code B ref 10348); Mon, 26 Dec 2011 11:11:01 +0000 Received: (at 10348) by debbugs.gnu.org; 26 Dec 2011 11:10:20 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rf8Rg-0000kz-Gk for submit@debbugs.gnu.org; Mon, 26 Dec 2011 06:10:20 -0500 Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Rf8Re-0000ks-Rb for 10348@debbugs.gnu.org; Mon, 26 Dec 2011 06:10:19 -0500 Received: (qmail invoked by alias); 26 Dec 2011 11:07:45 -0000 Received: from 62-47-52-66.adsl.highway.telekom.at (EHLO [62.47.52.66]) [62.47.52.66] by mail.gmx.net (mp033) with SMTP; 26 Dec 2011 12:07:45 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19gI/NIFFhgG2XhPZUeEn2RcQNlTze5T34ClIQKzB mCl5BJGUIVm1q4 Message-ID: <4EF85580.6040607@gmx.at> Date: Mon, 26 Dec 2011 12:07:44 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> <4EF59B02.9060608@gmx.at> <4EF72BE9.60604@gmx.at> <87wr9kuyew.fsf@mail.jurta.org> In-Reply-To: <87wr9kuyew.fsf@mail.jurta.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) > Or to implement window-local variables like buffer-local variables. You mean in the sense of `desktop-buffer-locals'? martin From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Dec 2011 18:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132492407417819 (code B ref 10348); Mon, 26 Dec 2011 18:28:02 +0000 Received: (at 10348) by debbugs.gnu.org; 26 Dec 2011 18:27:54 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RfFH8-0004dM-4E for submit@debbugs.gnu.org; Mon, 26 Dec 2011 13:27:54 -0500 Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1RfFH6-0004dF-HM for 10348@debbugs.gnu.org; Mon, 26 Dec 2011 13:27:53 -0500 Received: (qmail invoked by alias); 26 Dec 2011 18:25:16 -0000 Received: from 62-47-52-66.adsl.highway.telekom.at (EHLO [62.47.52.66]) [62.47.52.66] by mail.gmx.net (mp026) with SMTP; 26 Dec 2011 19:25:16 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/VYLJnW+zV+DqPT9PPFpFLJBiaIl48j9GegeF6Hu kMlOvF3s7gUr9T Message-ID: <4EF8BC0B.6020805@gmx.at> Date: Mon, 26 Dec 2011 19:25:15 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> <4EF59B02.9060608@gmx.at> <4EF72BE9.60604@gmx.at> <4EF8557A.3020001@gmx.at> In-Reply-To: <4EF8557A.3020001@gmx.at> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) Looking into this I noticed the following: There's already a variable `window-state-ignored-parameters'. But it's broken since `window-state-get-1' doesn't copy the parameter (so it behaves just like `current-window-configuration') and it doesn't affect the `clone-of' parameter. So I'm afraid that we might need two variables say `window-state-saved-parameters' and `window-state-ignored-parameters'. The former would explicitly name the parameters that have to be preserved accross window configuration changes. The latter would be responsible for not writing out parameters to disk. The semantics of `window-state-saved-parameters' across a `save-window-excursion' would then be as follows: (1) If a parameter is a member of `window-state-saved-parameters' `current-window-configuration' makes a copy of its value in the window_parameters slot of saved_window. (2) For each window, `set-window-configuration' clears out any non-nil value of a parameter in `window-state-saved-parameters'. Thereafter it does a `set-window-parameter' for all entries it finds in the window_parameters slot of that window's saved_window entry. This approach is inconsistent if `window-state-saved-parameters' changes within the body of the `save-window-excursion'. martin From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 28 Dec 2011 09:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132506598725661 (code B ref 10348); Wed, 28 Dec 2011 09:54:02 +0000 Received: (at 10348) by debbugs.gnu.org; 28 Dec 2011 09:53:07 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RfqC2-0006fq-Fi for submit@debbugs.gnu.org; Wed, 28 Dec 2011 04:53:06 -0500 Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1RfqBz-0006fi-Hr for 10348@debbugs.gnu.org; Wed, 28 Dec 2011 04:53:05 -0500 Received: (qmail invoked by alias); 28 Dec 2011 09:50:17 -0000 Received: from 62-47-52-13.adsl.highway.telekom.at (EHLO [62.47.52.13]) [62.47.52.13] by mail.gmx.net (mp027) with SMTP; 28 Dec 2011 10:50:17 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18HoZZNzGAHuVqZiWuIdf4Oz5nkFy7ULiWqUaLdKq fWENv7VMxvnsRM Message-ID: <4EFAE659.4090601@gmx.at> Date: Wed, 28 Dec 2011 10:50:17 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> <4EF59B02.9060608@gmx.at> <4EF72BE9.60604@gmx.at> <4EF8557A.3020001@gmx.at> <4EF8BC0B.6020805@gmx.at> In-Reply-To: <4EF8BC0B.6020805@gmx.at> Content-Type: multipart/mixed; boundary="------------000702050504020508070305" X-Y-GMX-Trusted: 0 X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) This is a multi-part message in MIME format. --------------000702050504020508070305 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit I wrote a tentative patch to handle this. Please have a look. Thanks, martin --------------000702050504020508070305 Content-Type: text/plain; name="window-parameters.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="window-parameters.diff" === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2011-12-13 13:37:48 +0000 +++ doc/lispref/windows.texi 2011-12-27 17:51:15 +0000 @@ -3104,9 +3104,24 @@ @defun current-window-configuration &optional frame This function returns a new object representing @var{frame}'s current window configuration. The default for @var{frame} is the selected -frame. +frame. This function copies the value of all window parameters listed +by @code{window-persistent-parameters}, see below. @end defun +@defvar window-persistent-parameters +This variable lists all window parameters that shall be saved by +@code{current-window-configuration}, see above, and restored by +@code{set-window-configuration}, see below. This means that the value +of any parameter listed by this variable and changed within the body of +@code{save-window-excursion} is restored to its previous value when the +window excursion exits. Parameters not listed by this variable are left +alone when the window excursion terminates. + +The parameters listed by this variable are treated in a similar manner +by the functions @code{window-state-get} and @code{window-state-put}, +see below. +@end defvar + @defun set-window-configuration configuration This function restores the configuration of windows and buffers as specified by @var{configuration}, for the frame that @var{configuration} @@ -3121,6 +3136,10 @@ know how to tell whether the new configuration actually differs from the old one. +This function restores the values of all window parameters listed by +@code{window-persistent-parameters}, see above, to their values saved in +@var{configuration}. + If the frame which @var{configuration} was saved from is dead, all this function does is restore the three variables @code{window-min-height}, @code{window-min-width} and @code{minibuffer-scroll-window}. In this @@ -3209,18 +3228,28 @@ configuration on disk and read it back in another Emacs session the following two functions can be used. -@defun window-state-get &optional window markers +@defun window-state-get &optional window ignore This function returns the state of @var{window} as a Lisp object. The argument @var{window} can be any window and defaults to the root window of the selected frame. -The optional argument @var{markers} non-@code{nil} means to use markers -for sampling positions like @code{window-point} or @code{window-start}. -This argument should be non-@code{nil} only if the value is used for -putting the state back in the same session since markers slow down -processing. +If the optional argument @var{ignore} is non-@code{nil}, this means to +not use markers for sampling positions like @code{window-point} or +@code{window-start} and to not save values of parameters in the list +@code{window-state-ignored-parameters}, see below. This argument should +be non-@code{nil} when the state shall be written on disk and read back +in another session. + +This function copies the value of all window parameters listed by the +variable @code{window-persistent-parameters}, see above. @end defun +@defvar window-state-ignored-parameters +This variable lists all parameters whose value must not be recorded by +the function @code{window-state-get} when its @var{ignore} argument is +non-@code{nil}, see above. +@end defvar + The value returned by @code{window-state-get} can be converted by using one of the functions defined by Desktop Save Mode (@pxref{Desktop Save Mode}) to an object that can be written to a file. Such objects can be @@ -3239,6 +3268,10 @@ minimum window sizes and fixed size restrictions. If @var{ignore} equals @code{safe}, this means windows can get as small as one line and/or two columns. + +This function restores the values of all window parameters listed by +@code{window-persistent-parameters}, see above, to their values in +@var{state}. @end defun === modified file 'lisp/window.el' --- lisp/window.el 2011-12-24 19:16:53 +0000 +++ lisp/window.el 2011-12-27 16:36:57 +0000 @@ -3568,10 +3568,12 @@ )) ;;; Window states, how to get them and how to put them in a window. -(defvar window-state-ignored-parameters '(quit-restore) - "List of window parameters ignored by `window-state-get'.") +(defvar window-state-ignored-parameters '(quit-restore clone-of) + "Window parameters ignored by `window-state-get'. +Parameters in this list are not saved by `window-state-get' when +its IGNORE argument is non-nil.") -(defun window--state-get-1 (window &optional markers) +(defun window--state-get-1 (window &optional ignore) "Helper function for `window-state-get'." (let* ((type (cond @@ -3590,11 +3592,18 @@ (combination-limit . ,(window-combination-limit window)) ,@(let (list) (dolist (parameter (window-parameters window)) - (unless (memq (car parameter) - window-state-ignored-parameters) - (setq list (cons parameter list)))) - (unless (window-parameter window 'clone-of) - ;; Make a clone-of parameter. + ;; When IGNORE is nil, add a parameter only if it is + ;; in `window-persistent-parameters'. When IGNORE is + ;; non-nil, add a parameter if and only if it is not + ;; in `window-state-ignored-parameters'. + (when (if ignore + (not (memq (car parameter) + window-state-ignored-parameters)) + (memq (car parameter) window-persistent-parameters)) + (setq list (cons (cons (car parameter) (cdr parameter)) + list)))) + (unless (or ignore (window-parameter window 'clone-of)) + ;; Make `clone-of' parameter unless IGNORE is non-nil. (setq list (cons (cons 'clone-of window) list))) (when list `((parameters . ,list)))) @@ -3616,30 +3625,32 @@ (scroll-bars . ,(window-scroll-bars window)) (vscroll . ,(window-vscroll window)) (dedicated . ,(window-dedicated-p window)) - (point . ,(if markers (copy-marker point) point)) - (start . ,(if markers (copy-marker start) start)) + (point . ,(if ignore point (copy-marker point))) + (start . ,(if ignore start (copy-marker start))) ,@(when mark - `((mark . ,(if markers - (copy-marker mark) mark))))))))))) + `((mark . ,(if ignore + mark (copy-marker mark)))))))))))) (tail (when (memq type '(vc hc)) (let (list) (setq window (window-child window)) (while window - (setq list (cons (window--state-get-1 window markers) list)) + (setq list (cons (window--state-get-1 window ignore) list)) (setq window (window-right window))) (nreverse list))))) (append head tail))) -(defun window-state-get (&optional window markers) +(defun window-state-get (&optional window ignore) "Return state of WINDOW as a Lisp object. WINDOW can be any window and defaults to the root window of the selected frame. -Optional argument MARKERS non-nil means use markers for sampling -positions like `window-point' or `window-start'. MARKERS should -be non-nil only if the value is used for putting the state back -in the same session (note that markers slow down processing). +Optional argument IGNORE non-nil means do not use markers for +sampling positions like `window-point' or `window-start' and do +not record ignored window parameters as specified by +`window-state-ignored-parameters'. IGNORE should be non-nil when +the return value shall be written to a file and read back in +another session. The return value can be used as argument for `window-state-put' to put the state recorded here into an arbitrary window. The @@ -3665,7 +3676,7 @@ ;; These are probably not needed. ,@(when (window-size-fixed-p window) `((fixed-height . t))) ,@(when (window-size-fixed-p window t) `((fixed-width . t)))) - (window--state-get-1 window markers))) + (window--state-get-1 window ignore))) (defvar window-state-put-list nil "Helper variable for `window-state-put'.") @@ -3744,6 +3755,10 @@ (state (cdr (assq 'buffer item)))) (when combination-limit (set-window-combination-limit window combination-limit)) + ;; nil out values of parameters in `window-persistent-parameters'. + (dolist (parameter (window-parameters window)) + (when (memq (car parameter) window-persistent-parameters) + (set-window-parameter window (car parameter) nil))) ;; Process parameters. (when parameters (dolist (parameter parameters) === modified file 'src/window.c' --- src/window.c 2011-12-13 13:58:20 +0000 +++ src/window.c 2011-12-27 09:37:03 +0000 @@ -5349,6 +5349,7 @@ (Lisp_Object configuration) { register struct save_window_data *data; + register Lisp_Object tem, car; struct Lisp_Vector *saved_windows; Lisp_Object new_current_buffer; Lisp_Object frame; @@ -5543,7 +5544,25 @@ w->vertical_scroll_bar_type = p->vertical_scroll_bar_type; w->dedicated = p->dedicated; w->combination_limit = p->combination_limit; - w->window_parameters = p->window_parameters; + /* nil out values of persistent window parameters. */ + if (!NILP (w->window_parameters)) + for (tem = w->window_parameters; CONSP (tem); tem = XCDR (tem)) + { + car = XCAR (tem); + if (CONSP (car) + && !NILP (Fmemq (XCAR (car), Vwindow_persistent_parameters))) + Fsetcdr (car, Qnil); + } + + /* Restore persistent window parameters. */ + if (!NILP (p->window_parameters)) + for (tem = p->window_parameters; CONSP (tem); tem = XCDR (tem)) + { + car = XCAR (tem); + if (CONSP (car)) + Fset_window_parameter (window, XCAR (car), XCDR (car)); + } + XSETFASTINT (w->last_modified, 0); XSETFASTINT (w->last_overlay_modified, 0); @@ -5810,7 +5829,7 @@ { register struct saved_window *p; register struct window *w; - register Lisp_Object tem; + register Lisp_Object tem, car; for (;!NILP (window); window = w->next) { @@ -5838,7 +5857,18 @@ p->vertical_scroll_bar_type = w->vertical_scroll_bar_type; p->dedicated = w->dedicated; p->combination_limit = w->combination_limit; - p->window_parameters = w->window_parameters; + p->window_parameters = Qnil; + /* Store copies of persistent window parameters. */ + if (!NILP (w->window_parameters)) + for (tem = w->window_parameters; CONSP (tem); tem = XCDR (tem)) + { + car = XCAR (tem); + if (CONSP (car) + && !NILP (Fmemq (XCAR (car), Vwindow_persistent_parameters))) + p->window_parameters = Fcons (Fcons (XCAR (car), XCDR (car)), + p->window_parameters); + } + if (!NILP (w->buffer)) { /* Save w's value of point in the window configuration. @@ -6542,6 +6572,13 @@ function `set-window-combination-limit'. */); Vwindow_combination_limit = Qnil; + DEFVAR_LISP ("window-persistent-parameters", Vwindow_persistent_parameters, + doc: /* List of persistent window parameters. +The parameters in this list are saved by `current-window-configuration' +and `window-state-get' and restored by `set-window-configuration' and +`window-state-put'. */); + Vwindow_persistent_parameters = Qnil; + defsubr (&Sselected_window); defsubr (&Sminibuffer_window); defsubr (&Swindow_minibuffer_p); --------------000702050504020508070305-- From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 28 Dec 2011 11:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.1325071230866 (code B ref 10348); Wed, 28 Dec 2011 11:21:01 +0000 Received: (at 10348) by debbugs.gnu.org; 28 Dec 2011 11:20:30 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RfrYb-0000Du-Pf for submit@debbugs.gnu.org; Wed, 28 Dec 2011 06:20:30 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RfrYY-0000Dh-Jd for 10348@debbugs.gnu.org; Wed, 28 Dec 2011 06:20:27 -0500 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id pBSBHVdL013469; Wed, 28 Dec 2011 06:17:33 -0500 Received: by ceviche.home (Postfix, from userid 20848) id A4D6C6671C; Tue, 27 Dec 2011 18:23:00 -0500 (EST) From: Stefan Monnier Message-ID: References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> <4EF59B02.9060608@gmx.at> <4EF72BE9.60604@gmx.at> <4EF8557A.3020001@gmx.at> <4EF8BC0B.6020805@gmx.at> Date: Tue, 27 Dec 2011 18:23:00 -0500 In-Reply-To: <4EF8BC0B.6020805@gmx.at> (martin rudalics's message of "Mon, 26 Dec 2011 19:25:15 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4084=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4084> : streams <714547> : uri <1036205> X-Spam-Score: -4.1 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.1 (----) > The former would explicitly name the parameters that have to be > preserved accross window configuration changes. The latter would be > responsible for not writing out parameters to disk. It seems that we indeed need to distinguish window-states for inter-session use and for intra-session use (e.g. via the `markers' argument). And of course the parameters preserved intra-session is a superset of the parameters preserved inter-sessions. Using window-state-ignored-parameters to specify the difference between the two sets seems OK. > This approach is inconsistent if `window-state-saved-parameters' changes > within the body of the `save-window-excursion'. Indeed, it's a bit ugly. An alternative would be to ignore window-state-saved-parameters (and window-state-ignored-parameters) upon restore. Instead, we'd save the parameters in a list where each element is either (PARM . VAL) or just PARM where the second form indicates that PARM was not set and should hence be unset upon restore. Stefan From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 28 Dec 2011 16:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.13250880185757 (code B ref 10348); Wed, 28 Dec 2011 16:01:01 +0000 Received: (at 10348) by debbugs.gnu.org; 28 Dec 2011 16:00:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RfvvN-0001Un-Qf for submit@debbugs.gnu.org; Wed, 28 Dec 2011 11:00:18 -0500 Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1RfvvL-0001US-CC for 10348@debbugs.gnu.org; Wed, 28 Dec 2011 11:00:16 -0500 Received: (qmail invoked by alias); 28 Dec 2011 15:57:28 -0000 Received: from 62-47-52-13.adsl.highway.telekom.at (EHLO [62.47.52.13]) [62.47.52.13] by mail.gmx.net (mp007) with SMTP; 28 Dec 2011 16:57:28 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/KOQRdZz3KfQKLE6m35SL7eVDdXTwQ6HAEGvvod+ CeVw5A1nLskTC+ Message-ID: <4EFB3C66.6040104@gmx.at> Date: Wed, 28 Dec 2011 16:57:26 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> <4EF59B02.9060608@gmx.at> <4EF72BE9.60604@gmx.at> <4EF8557A.3020001@gmx.at> <4EF8BC0B.6020805@gmx.at> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) > And of course the parameters preserved intra-session is a superset of > the parameters preserved inter-sessions. I'm not so sure. Maybe a parameter is useful intra-session but not readable from disk. > Using window-state-ignored-parameters to specify the difference between > the two sets seems OK. You mean that any value present in `window-state-ignored-parameters' would have to be a member of the `window-persistent-parameters' I used in my patch? I'd rather not care about `window-state-ignored-parameters' in `current-window-configuration' or `set-window-configuration'. (BTW, I use `window-persistent-parameters' instead of `window-state-saved-parameters' because they apply to both, `current-window-configuration` and `window-state-get'.) > An alternative would be to ignore > window-state-saved-parameters (and window-state-ignored-parameters) So far, I didn't care about `window-state-ignored-parameters' when restoring a state in `window-state-put'. > upon restore. Instead, we'd save the parameters in a list where each > element is either (PARM . VAL) or just PARM where the second form > indicates that PARM was not set and should hence be unset upon restore. Fine with me. Obviously, this makes saved states a bit larger. martin From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Dec 2011 09:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132515206615393 (code B ref 10348); Thu, 29 Dec 2011 09:48:01 +0000 Received: (at 10348) by debbugs.gnu.org; 29 Dec 2011 09:47:46 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RgCaQ-00040E-Be for submit@debbugs.gnu.org; Thu, 29 Dec 2011 04:47:46 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RgCaN-0003zs-Fr for 10348@debbugs.gnu.org; Thu, 29 Dec 2011 04:47:44 -0500 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id pBT9imIu018973; Thu, 29 Dec 2011 04:44:50 -0500 Received: by ceviche.home (Postfix, from userid 20848) id E9F9466416; Wed, 28 Dec 2011 18:09:44 -0500 (EST) From: Stefan Monnier Message-ID: References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> <4EF59B02.9060608@gmx.at> <4EF72BE9.60604@gmx.at> <4EF8557A.3020001@gmx.at> <4EF8BC0B.6020805@gmx.at> <4EFB3C66.6040104@gmx.at> Date: Wed, 28 Dec 2011 18:09:44 -0500 In-Reply-To: <4EFB3C66.6040104@gmx.at> (martin rudalics's message of "Wed, 28 Dec 2011 16:57:26 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4085=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4085> : streams <714826> : uri <1036800> X-Spam-Score: -4.1 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.1 (----) >> And of course the parameters preserved intra-session is a superset of >> the parameters preserved inter-sessions. > I'm not so sure. Maybe a parameter is useful intra-session but not > readable from disk. I don't understand: you first seem to say you disagree with me, but then what you say afterwards seems to agree with me. >> Using window-state-ignored-parameters to specify the difference between >> the two sets seems OK. > You mean that any value present in `window-state-ignored-parameters' > would have to be a member of the `window-persistent-parameters' I used > in my patch? Not necessarily, but an element in window-state-ignored-parameters which is not in window-persistent-parameters would have no effect. > I'd rather not care about `window-state-ignored-parameters' in > `current-window-configuration' or `set-window-configuration'. That's OK, window-configurations are intra-session objects anyway, so if window-state-ignored-parameters specifies the difference between the two sets, it indeed can be ignored by `current-window-configuration' and `set-window-configuration'. > (BTW, I use `window-persistent-parameters' instead of > `window-state-saved-parameters' because they apply to both, > `current-window-configuration` and `window-state-get'.) Yes, the name sounds fine. >> An alternative would be to ignore window-state-saved-parameters (and >> window-state-ignored-parameters) > So far, I didn't care about `window-state-ignored-parameters' when > restoring a state in `window-state-put'. Fine. >> upon restore. Instead, we'd save the parameters in a list where each >> element is either (PARM . VAL) or just PARM where the second form >> indicates that PARM was not set and should hence be unset upon restore. > Fine with me. Obviously, this makes saved states a bit larger. Indeed, but otherwise, as you pointed out, it makes the semantics rather tricky if window-persistent-parameters is changed between the save and the restore (which is something that is very likely to happen sometimes since the restore may happen years after the save). Stefan From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Dec 2011 11:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.132515894125413 (code B ref 10348); Thu, 29 Dec 2011 11:43:02 +0000 Received: (at 10348) by debbugs.gnu.org; 29 Dec 2011 11:42:21 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RgENI-0006bp-Iu for submit@debbugs.gnu.org; Thu, 29 Dec 2011 06:42:21 -0500 Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1RgENC-0006be-UO for 10348@debbugs.gnu.org; Thu, 29 Dec 2011 06:42:17 -0500 Received: (qmail invoked by alias); 29 Dec 2011 11:39:23 -0000 Received: from 62-47-44-99.adsl.highway.telekom.at (EHLO [62.47.44.99]) [62.47.44.99] by mail.gmx.net (mp058) with SMTP; 29 Dec 2011 12:39:23 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19zJPhfhkxzDNlrgPiWaf5yiGUEfJNpejurm0v+vM SWppLmVs8SWonb Message-ID: <4EFC5161.8040808@gmx.at> Date: Thu, 29 Dec 2011 12:39:13 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> <4EF59B02.9060608@gmx.at> <4EF72BE9.60604@gmx.at> <4EF8557A.3020001@gmx.at> <4EF8BC0B.6020805@gmx.at> <4EFB3C66.6040104@gmx.at> In-Reply-To: Content-Type: multipart/mixed; boundary="------------050300020408020508060900" X-Y-GMX-Trusted: 0 X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) This is a multi-part message in MIME format. --------------050300020408020508060900 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit > I don't understand: you first seem to say you disagree with me, but then > what you say afterwards seems to agree with me. Indeed. > Indeed, but otherwise, as you pointed out, it makes the semantics rather > tricky if window-persistent-parameters is changed between the save and > the restore (which is something that is very likely to happen sometimes > since the restore may happen years after the save). I resolved the semantics by saving always all parameters unless I do `window-state-get' with IGNORE non-nil and the parameter is in `window-state-ignored-parameters'. When restoring parameters via `set-window-configuration'/`window-state-put', I overwrite/install a value only if the parameter is in `window-persistent-parameters'. martin --------------050300020408020508060900 Content-Type: text/plain; name="window-parameters.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="window-parameters.diff" === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2011-12-13 13:37:48 +0000 +++ doc/lispref/windows.texi 2011-12-29 10:34:38 +0000 @@ -3104,7 +3104,7 @@ @defun current-window-configuration &optional frame This function returns a new object representing @var{frame}'s current window configuration. The default for @var{frame} is the selected -frame. +frame. This function copies the value of all window parameters. @end defun @defun set-window-configuration configuration @@ -3121,6 +3121,9 @@ know how to tell whether the new configuration actually differs from the old one. +This function restores the values of all window parameters listed by +@code{window-persistent-parameters}, see below. + If the frame which @var{configuration} was saved from is dead, all this function does is restore the three variables @code{window-min-height}, @code{window-min-width} and @code{minibuffer-scroll-window}. In this @@ -3140,6 +3143,18 @@ @end example @end defun +@defvar window-persistent-parameters +This variable lists all window parameters that are restored by +@code{set-window-configuration}, see above. This means that the value +of any parameter listed by this variable and changed within the body of +@code{save-window-excursion} is restored to its previous value when the +window excursion exits. Parameters not listed by this variable are left +alone when the window excursion terminates. + +Parameters not listed by this variable are effectively not installed by +the function @code{window-state-put}, see below. +@end defvar + @defspec save-window-excursion forms@dots{} This special form records the window configuration, executes @var{forms} in sequence, then restores the earlier window configuration. The window @@ -3209,18 +3224,25 @@ configuration on disk and read it back in another Emacs session the following two functions can be used. -@defun window-state-get &optional window markers +@defun window-state-get &optional window ignore This function returns the state of @var{window} as a Lisp object. The argument @var{window} can be any window and defaults to the root window of the selected frame. -The optional argument @var{markers} non-@code{nil} means to use markers -for sampling positions like @code{window-point} or @code{window-start}. -This argument should be non-@code{nil} only if the value is used for -putting the state back in the same session since markers slow down -processing. +If the optional argument @var{ignore} is non-@code{nil}, this means to +not use markers for sampling positions like @code{window-point} or +@code{window-start} and to not save values of parameters in the list +@code{window-state-ignored-parameters}, see below. This argument should +be non-@code{nil} when the state shall be written on disk and read back +in another session. @end defun +@defvar window-state-ignored-parameters +This variable lists all parameters whose value is not recorded by the +function @code{window-state-get} when its @var{ignore} argument is +non-@code{nil}, see above. +@end defvar + The value returned by @code{window-state-get} can be converted by using one of the functions defined by Desktop Save Mode (@pxref{Desktop Save Mode}) to an object that can be written to a file. Such objects can be @@ -3239,6 +3261,10 @@ minimum window sizes and fixed size restrictions. If @var{ignore} equals @code{safe}, this means windows can get as small as one line and/or two columns. + +This function installs the values of all window parameters listed by +@code{window-persistent-parameters}, see above, provided their values +are stored in @var{state}. @end defun === modified file 'lisp/window.el' --- lisp/window.el 2011-12-24 19:16:53 +0000 +++ lisp/window.el 2011-12-29 10:11:05 +0000 @@ -3568,10 +3568,12 @@ )) ;;; Window states, how to get them and how to put them in a window. -(defvar window-state-ignored-parameters '(quit-restore) - "List of window parameters ignored by `window-state-get'.") +(defvar window-state-ignored-parameters '(quit-restore clone-of) + "Window parameters ignored by `window-state-get'. +Parameters in this list are not saved by `window-state-get' when +its IGNORE argument is non-nil.") -(defun window--state-get-1 (window &optional markers) +(defun window--state-get-1 (window &optional ignore) "Helper function for `window-state-get'." (let* ((type (cond @@ -3590,11 +3592,15 @@ (combination-limit . ,(window-combination-limit window)) ,@(let (list) (dolist (parameter (window-parameters window)) - (unless (memq (car parameter) - window-state-ignored-parameters) - (setq list (cons parameter list)))) - (unless (window-parameter window 'clone-of) - ;; Make a clone-of parameter. + ;; When IGNORE is non-nil, add a parameter if and only + ;; if it is not in `window-state-ignored-parameters'. + (unless (and ignore + (memq (car parameter) + window-state-ignored-parameters)) + (setq list (cons (cons (car parameter) (cdr parameter)) + list)))) + (unless (or ignore (window-parameter window 'clone-of)) + ;; Make `clone-of' parameter unless IGNORE is non-nil. (setq list (cons (cons 'clone-of window) list))) (when list `((parameters . ,list)))) @@ -3616,30 +3622,32 @@ (scroll-bars . ,(window-scroll-bars window)) (vscroll . ,(window-vscroll window)) (dedicated . ,(window-dedicated-p window)) - (point . ,(if markers (copy-marker point) point)) - (start . ,(if markers (copy-marker start) start)) + (point . ,(if ignore point (copy-marker point))) + (start . ,(if ignore start (copy-marker start))) ,@(when mark - `((mark . ,(if markers - (copy-marker mark) mark))))))))))) + `((mark . ,(if ignore + mark (copy-marker mark)))))))))))) (tail (when (memq type '(vc hc)) (let (list) (setq window (window-child window)) (while window - (setq list (cons (window--state-get-1 window markers) list)) + (setq list (cons (window--state-get-1 window ignore) list)) (setq window (window-right window))) (nreverse list))))) (append head tail))) -(defun window-state-get (&optional window markers) +(defun window-state-get (&optional window ignore) "Return state of WINDOW as a Lisp object. WINDOW can be any window and defaults to the root window of the selected frame. -Optional argument MARKERS non-nil means use markers for sampling -positions like `window-point' or `window-start'. MARKERS should -be non-nil only if the value is used for putting the state back -in the same session (note that markers slow down processing). +Optional argument IGNORE non-nil means do not use markers for +sampling positions like `window-point' or `window-start' and do +not record ignored window parameters as specified by +`window-state-ignored-parameters'. IGNORE should be non-nil when +the return value shall be written to a file and read back in +another session. The return value can be used as argument for `window-state-put' to put the state recorded here into an arbitrary window. The @@ -3665,7 +3673,7 @@ ;; These are probably not needed. ,@(when (window-size-fixed-p window) `((fixed-height . t))) ,@(when (window-size-fixed-p window t) `((fixed-width . t)))) - (window--state-get-1 window markers))) + (window--state-get-1 window ignore))) (defvar window-state-put-list nil "Helper variable for `window-state-put'.") @@ -3744,10 +3752,15 @@ (state (cdr (assq 'buffer item)))) (when combination-limit (set-window-combination-limit window combination-limit)) - ;; Process parameters. + ;; nil out values of parameters in `window-persistent-parameters'. + (dolist (parameter (window-parameters window)) + (when (memq (car parameter) window-persistent-parameters) + (set-window-parameter window (car parameter) nil))) + ;; Assign persistent window parameters. (when parameters (dolist (parameter parameters) - (set-window-parameter window (car parameter) (cdr parameter)))) + (when (memq (car parameter) window-persistent-parameters) + (set-window-parameter window (car parameter) (cdr parameter))))) ;; Process buffer related state. (when state ;; We don't want to raise an error here so we create a buffer if === modified file 'src/window.c' --- src/window.c 2011-12-13 13:58:20 +0000 +++ src/window.c 2011-12-29 11:21:42 +0000 @@ -5349,6 +5349,7 @@ (Lisp_Object configuration) { register struct save_window_data *data; + register Lisp_Object tem, car; struct Lisp_Vector *saved_windows; Lisp_Object new_current_buffer; Lisp_Object frame; @@ -5543,7 +5544,26 @@ w->vertical_scroll_bar_type = p->vertical_scroll_bar_type; w->dedicated = p->dedicated; w->combination_limit = p->combination_limit; - w->window_parameters = p->window_parameters; + /* nil out values of persistent window parameters. */ + if (!NILP (w->window_parameters)) + for (tem = w->window_parameters; CONSP (tem); tem = XCDR (tem)) + { + car = XCAR (tem); + if (CONSP (car) + && !NILP (Fmemq (XCAR (car), Vwindow_persistent_parameters))) + Fsetcdr (car, Qnil); + } + + /* Restore persistent window parameters. */ + if (!NILP (p->window_parameters)) + for (tem = p->window_parameters; CONSP (tem); tem = XCDR (tem)) + { + car = XCAR (tem); + if (CONSP (car) + && !NILP (Fmemq (XCAR (car), Vwindow_persistent_parameters))) + Fset_window_parameter (window, XCAR (car), XCDR (car)); + } + XSETFASTINT (w->last_modified, 0); XSETFASTINT (w->last_overlay_modified, 0); @@ -5810,7 +5830,7 @@ { register struct saved_window *p; register struct window *w; - register Lisp_Object tem; + register Lisp_Object tem, car; for (;!NILP (window); window = w->next) { @@ -5838,7 +5858,11 @@ p->vertical_scroll_bar_type = w->vertical_scroll_bar_type; p->dedicated = w->dedicated; p->combination_limit = w->combination_limit; - p->window_parameters = w->window_parameters; + /* Store copies of all window parameters. When + Fset_window_configuration later considers a parameter as + persistent it will take it from the copy stored here. */ + p->window_parameters = Fcopy_alist (w->window_parameters); + if (!NILP (w->buffer)) { /* Save w's value of point in the window configuration. @@ -6542,6 +6566,15 @@ function `set-window-combination-limit'. */); Vwindow_combination_limit = Qnil; + DEFVAR_LISP ("window-persistent-parameters", Vwindow_persistent_parameters, + doc: /* List of persistent window parameters. + +The parameters in this list are restored to their previous values by the +functions `set-window-configuration' and `window-state-put'. Any +parameterts not listed here are left alone by `set-window-configuration' +respectively not installed by `window-state-put'. */); + Vwindow_persistent_parameters = Qnil; + defsubr (&Sselected_window); defsubr (&Sminibuffer_window); defsubr (&Swindow_minibuffer_p); --------------050300020408020508060900-- From unknown Sat Sep 20 09:42:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10348: 24.0.92; Save and load window states Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Jan 2012 09:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Michael Bach , 10348@debbugs.gnu.org Received: via spool by 10348-submit@debbugs.gnu.org id=B10348.13267070292473 (code B ref 10348); Mon, 16 Jan 2012 09:44:01 +0000 Received: (at 10348) by debbugs.gnu.org; 16 Jan 2012 09:43:49 +0000 Received: from localhost ([127.0.0.1]:59187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rmj6T-0000do-05 for submit@debbugs.gnu.org; Mon, 16 Jan 2012 04:43:49 -0500 Received: from mailout-de.gmx.net ([213.165.64.22]:53829) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1Rmj6Q-0000dh-GM for 10348@debbugs.gnu.org; Mon, 16 Jan 2012 04:43:47 -0500 Received: (qmail invoked by alias); 16 Jan 2012 09:42:51 -0000 Received: from 62-47-35-175.adsl.highway.telekom.at (EHLO [62.47.35.175]) [62.47.35.175] by mail.gmx.net (mp026) with SMTP; 16 Jan 2012 10:42:51 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19cq2xN9nNcb8X9qa3Ri7HcBJX9MotTbBQbwhXJy5 HmUgtDgwpZTLEZ Message-ID: <4F13F115.4060901@gmx.at> Date: Mon, 16 Jan 2012 10:42:45 +0100 From: martin rudalics MIME-Version: 1.0 References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> <4EF36318.6000006@gmx.at> <4EF45888.3030204@gmx.at> <4EF59B02.9060608@gmx.at> <4EF72BE9.60604@gmx.at> <4EF8557A.3020001@gmx.at> <4EF8BC0B.6020805@gmx.at> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > An alternative would be to ignore > window-state-saved-parameters (and window-state-ignored-parameters) > upon restore. Instead, we'd save the parameters in a list where each > element is either (PARM . VAL) or just PARM where the second form > indicates that PARM was not set and should hence be unset upon restore. I more or less installed this now. Please have a look. martin From unknown Sat Sep 20 09:42:06 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Michael Bach Subject: bug#10348: closed (Re: bug#10348: 24.0.92; Save and load window states) Message-ID: References: <4F13F124.8070403@gmx.at> <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> X-Gnu-PR-Message: they-closed 10348 X-Gnu-PR-Package: emacs Reply-To: 10348@debbugs.gnu.org Date: Mon, 16 Jan 2012 09:44:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1326707042-2513-1" This is a multi-part message in MIME format... ------------=_1326707042-2513-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #10348: 24.0.92; Save and load window states which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 10348@debbugs.gnu.org. --=20 10348: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D10348 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1326707042-2513-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 10348-done) by debbugs.gnu.org; 16 Jan 2012 09:43:59 +0000 Received: from localhost ([127.0.0.1]:59190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rmj6c-0000e8-AN for submit@debbugs.gnu.org; Mon, 16 Jan 2012 04:43:59 -0500 Received: from mailout-de.gmx.net ([213.165.64.23]:44798) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1Rmj6a-0000e1-5x for 10348-done@debbugs.gnu.org; Mon, 16 Jan 2012 04:43:57 -0500 Received: (qmail invoked by alias); 16 Jan 2012 09:43:01 -0000 Received: from 62-47-35-175.adsl.highway.telekom.at (EHLO [62.47.35.175]) [62.47.35.175] by mail.gmx.net (mp003) with SMTP; 16 Jan 2012 10:43:01 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19FEFZpCNNFdEaQNVlc9ibsVHj9uSH/9kgmO/1V3k J1GwG7OURWi7G1 Message-ID: <4F13F124.8070403@gmx.at> Date: Mon, 16 Jan 2012 10:43:00 +0100 From: martin rudalics MIME-Version: 1.0 To: 10348-done@debbugs.gnu.org Subject: Re: bug#10348: 24.0.92; Save and load window states References: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> In-Reply-To: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10348-done Cc: Michael Bach X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > `window-state-put' as used within the following functions does not work. > Please see *Backtrace* below for error. (See also post to > help-gnu-emacs@gnu.org with subject "Save and load window states") > > Steps to reproduce: > 1) Start via `emacs -Q'. > 2) evaluate the two functions: > (defun my-save-frame () > (interactive) > (let ((buf (find-file-noselect "/tmp/emacs-layout"))) > (set-buffer buf) > (erase-buffer) > (print (window-state-get) buf) > (save-buffer) > (kill-buffer))) > > (defun my-load-frame () > (interactive) > (let ((buf (find-file-noselect "/tmp/emacs-layout"))) > (set-buffer buf) > (beginning-of-buffer) > (window-state-put (read buf)) > (kill-buffer))) > > 3) Do a `M-x my-save-frame' and after that `M-x my-load-frame' > > Debugger entered--Lisp error: (invalid-read-syntax "#") > read(#) > (window-state-put (read buf)) > (let ((buf (find-file-noselect "/tmp/emacs-layout"))) (set-buffer buf) (beginning-of-buffer) (window-state-put (read buf)) (save-buffer) (kill-buffer)) > my-load-frame() > call-interactively(my-load-frame t nil) > execute-extended-command(nil) > call-interactively(execute-extended-command nil nil) This problem should have been resolved with revision 106873 on trunk. Thanks, martin ------------=_1326707042-2513-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 22 Dec 2011 01:39:13 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RdXcj-0007wP-O6 for submit@debbugs.gnu.org; Wed, 21 Dec 2011 20:39:12 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RdSwW-0000TK-N4 for submit@debbugs.gnu.org; Wed, 21 Dec 2011 15:39:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RdSuT-00071D-UC for submit@debbugs.gnu.org; Wed, 21 Dec 2011 15:37:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:41807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdSuT-000719-Sl for submit@debbugs.gnu.org; Wed, 21 Dec 2011 15:37:09 -0500 Received: from eggs.gnu.org ([140.186.70.92]:42430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdSuS-0002dv-QT for bug-gnu-emacs@gnu.org; Wed, 21 Dec 2011 15:37:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RdSuR-00070q-PG for bug-gnu-emacs@gnu.org; Wed, 21 Dec 2011 15:37:08 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:45963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdSuR-00070k-Fg for bug-gnu-emacs@gnu.org; Wed, 21 Dec 2011 15:37:07 -0500 Received: by eekc41 with SMTP id c41so8208584eek.0 for ; Wed, 21 Dec 2011 12:37:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:mime-version:content-type; bh=fhp9staakHHR6rhgVSpIEdFzO/pma7gp37SEfsmN9yM=; b=WFJOy0/2B1w2vml1yPe4lNe7YRLJLbMSLg4ztP7XYve9Vv+5g2mJVquSjHHSB3XzUx eIt/o6epXnqeODoXA9qY2tKomfqWNadV1MKNcZCPWV9165gI7qOVqTbd61VW9XbI6MYn HE57adGnV2x9GuOgjWc4dT0cewMFs2gt132Hw= Received: by 10.213.114.140 with SMTP id e12mr1654555ebq.78.1324499826439; Wed, 21 Dec 2011 12:37:06 -0800 (PST) Received: from voschtro (chello084112087167.3.11.univie.teleweb.at. [84.112.87.167]) by mx.google.com with ESMTPS id j20sm24736908eej.8.2011.12.21.12.37.05 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Dec 2011 12:37:05 -0800 (PST) From: Michael Bach To: bug-gnu-emacs@gnu.org Subject: 24.0.92; Save and load window states Date: Wed, 21 Dec 2011 21:41:05 +0100 Message-ID: <4ef24371.94110e0a.6fbb.ffffc8f3@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 21 Dec 2011 20:39:05 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) `window-state-put' as used within the following functions does not work. Please see *Backtrace* below for error. (See also post to help-gnu-emacs@gnu.org with subject "Save and load window states") Steps to reproduce: 1) Start via `emacs -Q'. 2) evaluate the two functions: (defun my-save-frame () (interactive) (let ((buf (find-file-noselect "/tmp/emacs-layout"))) (set-buffer buf) (erase-buffer) (print (window-state-get) buf) (save-buffer) (kill-buffer))) (defun my-load-frame () (interactive) (let ((buf (find-file-noselect "/tmp/emacs-layout"))) (set-buffer buf) (beginning-of-buffer) (window-state-put (read buf)) (kill-buffer))) 3) Do a `M-x my-save-frame' and after that `M-x my-load-frame' Debugger entered--Lisp error: (invalid-read-syntax "#") read(#) (window-state-put (read buf)) (let ((buf (find-file-noselect "/tmp/emacs-layout"))) (set-buffer buf) (beginning-of-buffer) (window-state-put (read buf)) (save-buffer) (kill-buffer)) my-load-frame() call-interactively(my-load-frame t nil) execute-extended-command(nil) call-interactively(execute-extended-command nil nil) Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8 default enable-multibyte-characters: t Recent messages: Wrote /tmp/emacs-layout Quit Mark set window-state-put: Invalid read syntax: "#" ------------=_1326707042-2513-1--