From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.bugs Subject: bug#33532: 26.1; set-window-configuration does not restore display start Date: Thu, 29 Nov 2018 19:09:47 +0100 Message-ID: <8736rj4uxg.fsf@metalevel.at> References: <87efb62mt2.fsf@metalevel.at> <83o9a9g0ui.fsf@gnu.org> <877egxyvje.fsf@metalevel.at> <5BFFA3FB.4060603@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1543514886 18256 195.159.176.226 (29 Nov 2018 18:08:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 29 Nov 2018 18:08:06 +0000 (UTC) User-Agent: Emacs/24.5 Cc: 33532@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 29 19:08:02 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gSQjI-0004bs-Ss for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Nov 2018 19:08:01 +0100 Original-Received: from localhost ([::1]:55672 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSQlP-000850-Fz for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Nov 2018 13:10:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSQlJ-00084u-Mh for bug-gnu-emacs@gnu.org; Thu, 29 Nov 2018 13:10:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSQlH-0002T9-10 for bug-gnu-emacs@gnu.org; Thu, 29 Nov 2018 13:10:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50825) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gSQlG-0002RY-9M for bug-gnu-emacs@gnu.org; Thu, 29 Nov 2018 13:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gSQlF-00016O-UE for bug-gnu-emacs@gnu.org; Thu, 29 Nov 2018 13:10:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Markus Triska Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Nov 2018 18:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33532 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33532-submit@debbugs.gnu.org id=B33532.15435149914216 (code B ref 33532); Thu, 29 Nov 2018 18:10:01 +0000 Original-Received: (at 33532) by debbugs.gnu.org; 29 Nov 2018 18:09:51 +0000 Original-Received: from localhost ([127.0.0.1]:55083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gSQl5-00015w-7U for submit@debbugs.gnu.org; Thu, 29 Nov 2018 13:09:51 -0500 Original-Received: from metalevel.at ([78.46.218.83]:55666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gSQl3-00015n-Hn for 33532@debbugs.gnu.org; Thu, 29 Nov 2018 13:09:49 -0500 Original-Received: by metalevel.at (Postfix, from userid 1000) id A9DCFA0F57; Thu, 29 Nov 2018 19:09:47 +0100 (CET) In-Reply-To: <5BFFA3FB.4060603@gmx.at> (martin rudalics's message of "Thu, 29 Nov 2018 09:31:55 +0100") 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:152898 Archived-At: martin rudalics writes: > and the functions mentioned there are `window-state-get' and > `window-state-put'. These functions have an analogous issue, which you can see with: (let ((buf (get-buffer-create "buf"))) (switch-to-buffer buf) (erase-buffer) (dotimes (x 10) (insert (format "x is %s\n" x))) (recenter 3) (sit-for 1) (let ((conf (window-state-get)) (ws (window-start)) (str (with-current-buffer buf (buffer-string)))) (with-current-buffer buf (erase-buffer) (insert str)) (window-state-put conf) (sit-for 1) (message "window-start: %s vs. %s" ws (window-start)))) > So you have to tell us what you want to fix: The behavior of window > configurations throughout one and the same Emacs session (which uses > markers to restore positions) or when restoring a previous session > (which relies on positions only). If possible, please fix both. I filed the simpler case first, but both functions are broken. For now, I would like to concentrate on the case that only involves variables in the same Emacs session, without saving files to disk. I can file a separate issue for the other function. > What is "to restore the exact same text in all buffers"? The text at > the time the configuration was stored in a register? It means the buffer text that can be obtained for example with (buffer-string), and can be restored exactly as it was at any time. The snippet I posted illustrates this case. > Restoring a window configuration (or state) can only use the buffer > text as is and adjust positions accordingly. This is what I am asking for, and what currently does not work. Please see the snippet I posted for a reproducible test case: The buffer text is what it was, but the start position is not restored. > Furthermore, there is no guarantee that the same buffer will be shown > in that window when the configuration is restored. The fact that other guarantees are also broken is definitely unfortunate. However, improving just the particular aspect I mentioned would already be extremely helpful for my use case. > If you use window states instead of configurations then this should > work. States store positions instead of markers. Please see above: The snippet shows that it doesn't work. Also, I am primarily interested in the window configuration, and the documentation suggests that the window-start is saved (and restored). If possible, please consider implementing this, or adjusting the documentation so that it states what is actually guaranteed. Thank you and all the best, Markus