From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#23858: 25.0.95; window-state-get doesn't preserve side window status Date: Tue, 28 Jun 2016 10:25:08 +0200 Message-ID: <57723464.50603@gmx.at> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1467102659 5330 80.91.229.3 (28 Jun 2016 08:30:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Jun 2016 08:30:59 +0000 (UTC) To: bmag bmag , 23858@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 28 10:30:48 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bHoPp-0002zE-RG for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Jun 2016 10:30:42 +0200 Original-Received: from localhost ([::1]:35017 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHoPg-0001bt-GE for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Jun 2016 04:30:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHoLQ-0006AT-IP for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2016 04:26:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHoLK-0002ze-3T for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2016 04:26:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHoLJ-0002zZ-WA for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2016 04:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bHoLJ-0005Y8-Qe for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2016 04:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Jun 2016 08:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23858 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23858-submit@debbugs.gnu.org id=B23858.146710232621291 (code B ref 23858); Tue, 28 Jun 2016 08:26:01 +0000 Original-Received: (at 23858) by debbugs.gnu.org; 28 Jun 2016 08:25:26 +0000 Original-Received: from localhost ([127.0.0.1]:58700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHoKk-0005XK-Ba for submit@debbugs.gnu.org; Tue, 28 Jun 2016 04:25:26 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:62431) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHoKi-0005X7-B0 for 23858@debbugs.gnu.org; Tue, 28 Jun 2016 04:25:24 -0400 Original-Received: from [192.168.1.100] ([212.95.7.74]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0M7Y9j-1bW1V41wGN-00xMm5; Tue, 28 Jun 2016 10:25:17 +0200 In-Reply-To: X-Provags-ID: V03:K0:zRfVN7uAIpYKdJjzKkiizV1UhKPv7S3b0sMwVTIZVeFhrpBSzYG vcI9cPfqXGGFI5UIrMjAcviHXTEhddHKajmGVdvFu9aZ6jxPsn6ee95Te+HjktuOBXw6lw8 BW6zuA2d6QJQpNESfyUhby3CRfwQk6OoVQ32ymNH3N5eb4IEHpaRttl2SCxT6zHbNvxX5tP A4lc94Jb1Ot7bB0CRXwOw== X-UI-Out-Filterresults: notjunk:1;V01:K0:iw3886g1T+s=:bmLeePiClalwr+jJ/fZoFI FN34zWcIgKeVst+YOaMve/CQ5KioE8jHV5UNCiHzmsA/6zXuiMMXBjoGSvVXP0wPs4Bc2DsKy N38W+hSF3Xe7jCSbfdJW7eD1et/oFSGeEaSz9iX6XrAgHADQ58nu/hFXTVSJJSSCWnDGcT2ji qoEy4O6f6rde4Xk/FFAn1fatMFGpYd6cg9VVgp6cLytAivRM1aabNYTpNumfyCrvSwWUM+J+S FM5fkRy3aRhZY1HYkk1VldV15vWm4vR9ROdZwmrK74mM+oxhYwQcQTgaFYSe0NRVdSU2P030K LOTmJoaSfhBsVlXoo5PzO2gitWK3zZtEyBGd9vo07hhyYE7n0BSstcoSzSeMzvQzD7LSlw6YY DxsKQ1LehxuKt0cHKHRGItpc4gu/TPMLyZfRmWfk1bobogA/yS6ilmYRwOv7EpFP80D66CQUP sllJx0Hdi397wvGi16bZW4CdJQjfiWKhpn7x2vIXCP6LaRYmnRMoaG2ejqlMSdGdqSHWcEeq2 9Ql2u3vnxC6VMPhHyNJnMozydVO40da/Leb9iRpaEb5HmfVDfoVBV+K1NDJuZdkPagYHW3Fj2 tBoiiCY+2XOudBy6oU1W33BtmZpX5gAj/FSXmf8lRDYG9SWMPac1Qqles5+PMUa/cgjZuqaDL v4+hlqJWey+pMfiJ4c7ZyZgnVCVbf4f7wLbXbeQb4WjcjPwCrffu/Y6oCG2e7lxexFVIyJV1L 7yUmC8ybiCY/1VlJf1KSCNM0VGBLsZ/Mv/zVSLdjGRLxUXbCr97V5n/lydg+8y8Em3nUIIq+ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:120173 Archived-At: > Calling 'window-state-get' to store a side window (or a window-tree th= at > contains a side window) and later calling 'window-state-put' to restor= e > the window doesn't keep the window's status as a side window. In other= > words, the 'window-side' and 'window-slot' window paramters are not > saved and restored by 'window-state-get' and 'window-state-put'. Correct. > I found that by adding the window parameters to > 'window-persistent-parameters' (details below), then 'window-state-get= ' > and 'window-state-put' do save and restore the side window's status as= a > side window. Doesn't it make sense to add 'window-slot' and > 'window-side' to the default value of 'window-persistent-parameters'? = Is > there a reason why it's not the case already? It would be a (slight) penalty for the majority of users who never use side windows. A more stringent problem is that I wouldn't know what to do with other window parameters like 'quit-restore', 'window-atom', 'delete-window', 'other-window'? Wouldn't it be inconsistent to add only these two to the list of persistent parameters? The major obstacle though is that side windows conceptually should not be saved by =E2=80=98window-state-get=E2=80=99 at all. This was part of = the IDE concept discussed on emacs-devel many years ago: The window states to save and restore are those of the interior (non-side) windows. Normally, the side windows would stay arranged permanently around the major non-side window and only the contents of the latter would change according to what the user prefers to work on. Alternatively, the side windows could be removed temporarily to give the user the entire frame estate for editing. In that case, the side windows would have to be regenerated from scratch whenever the user wanted to see them again. While inconvenient for the application programmer, I was told that the existing IDEs did that already and I also had no good idea of how to save/restore the state of side windows only w/o also saving/restoring the state of the major non-side window. I'm not sure wheter you can follow these arguments - feel free to ask whenever you find something incomprehensible ... > 1. emacs -Q > 2. evaluate (e.g. with 'M-:'): > (setq mywin (display-buffer (get-buffer-create "buff1") > '(display-buffer-in-side-window (side . left) (slot . 0)))) Out of curiosity: Which kinds of buffers do you display on the left? > 3. evaluate: > (window-parameter mywin 'window-side) > returned value: left > 4. evaluate: > (window-state-put (window-state-get mywin t) mywin) > 5. evaluate: > (window-parameter mywin 'window-side) > returned value: nil > expected value: left > > The 'window-slot' window-parameter is likewise reset from 0 to nil at > step 4. I'd prefer to remove the parameter in this case but so far was too lazy to implement that. > How I modified 'window-persistent-parameters' to fix the problem: > (add-to-list 'window-persistent-parameters '(window-side . writable)) > (add-to-list 'window-persistent-parameters '(window-slot . writable)) This is IMO the correct way to handle this. Does it work? Did you ever test it via the =E2=80=98desktop-save=E2=80=99 feature? martin