GNU logs - #33871, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 25 Dec 2018 21:43:01 +0000
Resent-Message-ID: <handler.33871.B.154577413515482 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 33871 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.154577413515482
          (code B ref -1); Tue, 25 Dec 2018 21:43:01 +0000
Received: (at submit) by debbugs.gnu.org; 25 Dec 2018 21:42:15 +0000
Received: from localhost ([127.0.0.1]:36481 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gbuSt-00041e-K6
	for submit <at> debbugs.gnu.org; Tue, 25 Dec 2018 16:42:15 -0500
Received: from eggs.gnu.org ([208.118.235.92]:58938)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1gbuSr-00041R-TS
 for submit <at> debbugs.gnu.org; Tue, 25 Dec 2018 16:42:14 -0500
Received: from lists.gnu.org ([208.118.235.17]:55288)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <juri@HIDDEN>) id 1gbuSm-0006lU-LW
 for submit <at> debbugs.gnu.org; Tue, 25 Dec 2018 16:42:08 -0500
Received: from eggs.gnu.org ([208.118.235.92]:33562)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <juri@HIDDEN>) id 1gbuSl-00062Z-Pc
 for bug-gnu-emacs@HIDDEN; Tue, 25 Dec 2018 16:42:08 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <juri@HIDDEN>) id 1gbuSg-0006gi-PR
 for bug-gnu-emacs@HIDDEN; Tue, 25 Dec 2018 16:42:07 -0500
Received: from purple.birch.relay.mailchannels.net ([23.83.209.150]:10454)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <juri@HIDDEN>) id 1gbuSf-0006bu-0s
 for bug-gnu-emacs@HIDDEN; Tue, 25 Dec 2018 16:42:02 -0500
X-Sender-Id: dreamhost|x-authsender|jurta@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id DCFE15C4979
 for <bug-gnu-emacs@HIDDEN>; Tue, 25 Dec 2018 21:41:57 +0000 (UTC)
Received: from pdx1-sub0-mail-a16.g.dreamhost.com (unknown [100.96.35.77])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id 9D4385C4977
 for <bug-gnu-emacs@HIDDEN>; Tue, 25 Dec 2018 21:41:57 +0000 (UTC)
X-Sender-Id: dreamhost|x-authsender|jurta@HIDDEN
Received: from pdx1-sub0-mail-a16.g.dreamhost.com (pop.dreamhost.com
 [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384)
 by 0.0.0.0:2500 (trex/5.16.2); Tue, 25 Dec 2018 21:41:57 +0000
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|jurta@HIDDEN
X-MailChannels-Auth-Id: dreamhost
X-Chief-Name: 2d5edfe35848c9a3_1545774117715_3421691566
X-MC-Loop-Signature: 1545774117715:3522945206
X-MC-Ingress-Time: 1545774117715
Received: from pdx1-sub0-mail-a16.g.dreamhost.com (localhost [127.0.0.1])
 by pdx1-sub0-mail-a16.g.dreamhost.com (Postfix) with ESMTP id 004E67F93B
 for <bug-gnu-emacs@HIDDEN>; Tue, 25 Dec 2018 13:41:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to
 :subject:date:message-id:mime-version:content-type; s=
 linkov.net; bh=UN8YPmNJQfBfAYLW1+FN4oJvp5Y=; b=MxL/H2rDhL3yHQxbn
 FRRhmVk9YpsbmvQ9yMp5gYEUI3ATKnO3i03lUdwjZdjz2TOGpQDoxUSpMm4FO0z7
 0igyS7weql/j0QIrlaH5o7z/NhFfsZrGYgSlklauHWe7+zqxOFjU9QcZby1GFNk0
 SAAZNJtRwPU64UKcIHRaTeGo78=
Received: from mail.jurta.org (m91-129-108-193.cust.tele2.ee [91.129.108.193])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256
 bits)) (No client certificate requested)
 (Authenticated sender: jurta@HIDDEN)
 by pdx1-sub0-mail-a16.g.dreamhost.com (Postfix) with ESMTPSA id 1CBD37F91D
 for <bug-gnu-emacs@HIDDEN>; Tue, 25 Dec 2018 13:41:54 -0800 (PST)
X-DH-BACKEND: pdx1-sub0-mail-a16
From: Juri Linkov <juri@HIDDEN>
Organization: LINKOV.NET
Date: Tue, 25 Dec 2018 23:39:03 +0200
Message-ID: <87bm59mglk.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-VR-OUT-STATUS: OK
X-VR-OUT-SCORE: 0
X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudekfedgudehiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufhofffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdekrdduleefnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtkedrudelfedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-Received-From: 23.83.209.150
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: -4.1 (----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.1 (-----)

Try to eval in emacs -Q in *scratch*:

(progn (dired "/tmp") (dired-next-line 1)
       (split-window) (other-window 1)
       (dired "/tmp") (dired-next-line 2)
       (let ((w-c (current-window-configuration))
	     (p-m (point-marker)))
	 (view-emacs-todo) (delete-other-windows)
	 (with-current-buffer (get-buffer "tmp")
	   (revert-buffer))
	 (set-window-configuration w-c)
	 (goto-char p-m)))

Result:
- point in the selected Dired window moves to point-min
- point in the non-selected Dired window moves to point-max




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Juri Linkov <juri@HIDDEN>
Subject: bug#33871: Acknowledgement (27.0.50; Revert Dired window saved in
 window configuration)
Message-ID: <handler.33871.B.154577413515482.ack <at> debbugs.gnu.org>
References: <87bm59mglk.fsf@HIDDEN>
X-Gnu-PR-Message: ack 33871
X-Gnu-PR-Package: emacs
Reply-To: 33871 <at> debbugs.gnu.org
Date: Tue, 25 Dec 2018 21:43:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 33871 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
33871: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D33871
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 26 Dec 2018 09:44:01 +0000
Resent-Message-ID: <handler.33871.B33871.154581739923074 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>, 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.154581739923074
          (code B ref 33871); Wed, 26 Dec 2018 09:44:01 +0000
Received: (at 33871) by debbugs.gnu.org; 26 Dec 2018 09:43:19 +0000
Received: from localhost ([127.0.0.1]:36594 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gc5ig-000605-Uj
	for submit <at> debbugs.gnu.org; Wed, 26 Dec 2018 04:43:19 -0500
Received: from mout.gmx.net ([212.227.17.20]:45901)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1gc5ig-0005zs-5W
 for 33871 <at> debbugs.gnu.org; Wed, 26 Dec 2018 04:43:18 -0500
Received: from [192.168.1.101] ([46.125.250.34]) by mail.gmx.com (mrgmx103
 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LvUwp-1hJMth0Zox-010fxj; Wed, 26
 Dec 2018 10:43:10 +0100
Message-ID: <5C234D27.40309@HIDDEN>
Date: Wed, 26 Dec 2018 10:43:03 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
References: <87bm59mglk.fsf@HIDDEN>
In-Reply-To: <87bm59mglk.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:nh/y9p7aSc+2AIzzoYjDQWFDVuUwH4iJtV4BjZRPz3sPBvgH19m
 qojo0EPQfT0nRaQm/3NLsoWHm4Y8vJ2ks4TvD05aJiSEfMG3yZbUCCEx280odBmyqdCv68z
 pIEkTG+o4sv9yk03BtoNf1DFuUlJenxz7gdtMIqAYEsgxP0pd454VWyMwJwQqDYBY744uIg
 RIFmrWNVVhXzIcD8syXUA==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:Rvbx8UHxfhM=:gFa8EFJiaCP0JUVvEWv6YR
 8L585O1IOEOW0uUUPy/TH9K/b1xk0BVWquto8zm+sqaG6pIsP1VXVhoJ/kdk8MKfnYUWidZlO
 G+ndYkgpbdVDX4QyH1mZhGlWke1qa5Jz/rQpB/9Hz3R2KpU8UIa2iU9aEQN08XU6ZDi6H0Cte
 GpyspERovADbpqUQudsIHvIa3Q/hmBR10tVEz/bwiUi+MNR4kKoPNH2GeIIt4ErIUdehHL+/A
 5QflRorPiDFzAODeEPuFatNlJY/N/EmScr+jsW6RBlRgT29bzzp5+U1dXSQ1Off7G6ySkHPID
 TfkMHUVnTvYFi0XC2g3h5aU45UQYWCHh25indLdZXoMIWfAwSmBYd9EY3vXNXLvt8hTAtjfVe
 mJJHxFHRK/19USD18yZnC/twQX7OhoAjL0YDknHvGONucvS7VwydDlULib0wotcDYh0Ghts5B
 cM1wB+VpVs9O1deSBmRAB+BvpsU0UEWLJ4HKdoZUX2Y4jzGj/VxxSMUDOPLgybv+xmYu/d0Ou
 9usDbGBgCiG6vXsuehxO//BXFq0Iz6AGM4ZGPGi5AJe3EkyYIW1YB5Z9IaN3L24fgcxZjRFEW
 ebishMg5KeAQNFypKm6gFj7wcJEnaGJ0YQmXHiqv+pAuwD1jdBFqnvO3UKUZwRrK2a67TBg3R
 D4jimjYUHrMYMo/BCl5GIAv+A+mC+wBFQuCmwXWO9+QKVHxJ21OCnPRtmgU1iwTOuxJunoCSf
 ocimL+DazgAk6Ek+lwaLo1vv3nE8Y1+y4cJI4xS4ZWzYZqDzzsfetoiVS/IiuyNJ9Y/F443/O
 JcnBeUh720K0+8JnmcYmiJ9GTiJuQ/M5Rvxe4IO9g9GWvSvGpQ3a8W1cX+0hSq/wwOKnCJm/q
 rHc5pSX4HY/0ceHaxjs1wIMK6FgaWdGdf0xuEjOY0xH7q5DeZCT7ApX2X7u138Yzu/fErO5x5
 5Uzzo3z22+A==
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > Try to eval in emacs -Q in *scratch*:
 >
 > (progn (dired "/tmp") (dired-next-line 1)
 >         (split-window) (other-window 1)
 >         (dired "/tmp") (dired-next-line 2)
 >         (let ((w-c (current-window-configuration))
 > 	     (p-m (point-marker)))
 > 	 (view-emacs-todo) (delete-other-windows)
 > 	 (with-current-buffer (get-buffer "tmp")
 > 	   (revert-buffer))
 > 	 (set-window-configuration w-c)
 > 	 (goto-char p-m)))
 >
 > Result:
 > - point in the selected Dired window moves to point-min
 > - point in the non-selected Dired window moves to point-max

You're obfuscating the underlying behavior with the 'dired-next-line'
and 'goto-char' calls but the final points are different without that.

Without your explicit moves, `dired' moves to the first file name in
the lower directory here.  So 'dired-move-to-filename' was called when
reverting the buffer and the 'set-window-configuration' "restores" the
lower window's point from the buffer's point because that window is
the selected one.  To confirm, try with the upper window selected
instead.

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 27 Dec 2018 00:16:02 +0000
Resent-Message-ID: <handler.33871.B33871.154586972227416 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.154586972227416
          (code B ref 33871); Thu, 27 Dec 2018 00:16:02 +0000
Received: (at 33871) by debbugs.gnu.org; 27 Dec 2018 00:15:22 +0000
Received: from localhost ([127.0.0.1]:38059 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcJKY-000785-Gi
	for submit <at> debbugs.gnu.org; Wed, 26 Dec 2018 19:15:22 -0500
Received: from ostrich.birch.relay.mailchannels.net ([23.83.209.138]:25393)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1gcJKT-00077s-94
 for 33871 <at> debbugs.gnu.org; Wed, 26 Dec 2018 19:15:17 -0500
X-Sender-Id: dreamhost|x-authsender|jurta@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id 24B742839B4;
 Thu, 27 Dec 2018 00:15:12 +0000 (UTC)
Received: from pdx1-sub0-mail-a49.g.dreamhost.com (unknown [100.96.26.166])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id CB61A2837AE;
 Thu, 27 Dec 2018 00:15:11 +0000 (UTC)
X-Sender-Id: dreamhost|x-authsender|jurta@HIDDEN
Received: from pdx1-sub0-mail-a49.g.dreamhost.com (pop.dreamhost.com
 [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384)
 by 0.0.0.0:2500 (trex/5.16.2); Thu, 27 Dec 2018 00:15:12 +0000
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|jurta@HIDDEN
X-MailChannels-Auth-Id: dreamhost
X-Continue-Stupid: 37b8359c6c994c4b_1545869711959_1994422357
X-MC-Loop-Signature: 1545869711959:518475683
X-MC-Ingress-Time: 1545869711959
Received: from pdx1-sub0-mail-a49.g.dreamhost.com (localhost [127.0.0.1])
 by pdx1-sub0-mail-a49.g.dreamhost.com (Postfix) with ESMTP id 6B5F67FC82;
 Wed, 26 Dec 2018 16:15:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc
 :subject:references:date:in-reply-to:message-id:mime-version
 :content-type; s=linkov.net; bh=HZJr8qwSdxHUJl7gk6ak+ZvkkS4=; b=
 sY3yGDX8QAhmTzG/08Ut2b7erh1IBpfx9LxxXc6/A9mxF5kKnj9YYAS+FtjwzgWg
 kToAjSkiLus4zO3+gXE9fgjNg1ooczlUK7aRiF1sOcOee+igQxAt8Mvrc76X4goH
 wEScm/Zx8Fm3rL70O4I/IecjTIhEw6zxukekOXXfoho=
Received: from mail.jurta.org (m91-129-108-193.cust.tele2.ee [91.129.108.193])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256
 bits)) (No client certificate requested)
 (Authenticated sender: jurta@HIDDEN)
 by pdx1-sub0-mail-a49.g.dreamhost.com (Postfix) with ESMTPSA id D5AA67FC7B;
 Wed, 26 Dec 2018 16:15:09 -0800 (PST)
X-DH-BACKEND: pdx1-sub0-mail-a49
From: Juri Linkov <juri@HIDDEN>
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <5C234D27.40309@HIDDEN>
Date: Thu, 27 Dec 2018 02:01:57 +0200
In-Reply-To: <5C234D27.40309@HIDDEN> (martin rudalics's message of "Wed, 26
 Dec 2018 10:43:03 +0100")
Message-ID: <87y38bhm6i.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-VR-OUT-STATUS: OK
X-VR-OUT-SCORE: -100
X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrtddugddulecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtkedrudelfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdekrdduleefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtoheprhhuuggrlhhitghssehgmhigrdgrthenucevlhhushhtvghrufhiiigvpedt
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>> Try to eval in emacs -Q in *scratch*:
>>
>> (progn (dired "/tmp") (dired-next-line 1)
>>         (split-window) (other-window 1)
>>         (dired "/tmp") (dired-next-line 2)
>>         (let ((w-c (current-window-configuration))
>> 	     (p-m (point-marker)))
>> 	 (view-emacs-todo) (delete-other-windows)
>> 	 (with-current-buffer (get-buffer "tmp")
>> 	   (revert-buffer))
>> 	 (set-window-configuration w-c)
>> 	 (goto-char p-m)))
>>
>> Result:
>> - point in the selected Dired window moves to point-min
>> - point in the non-selected Dired window moves to point-max
>
> You're obfuscating the underlying behavior with the 'dired-next-line'
> and 'goto-char' calls but the final points are different without that.
>
> Without your explicit moves, `dired' moves to the first file name in
> the lower directory here.  So 'dired-move-to-filename' was called when
> reverting the buffer and the 'set-window-configuration' "restores" the
> lower window's point from the buffer's point because that window is
> the selected one.

I see that without `goto-char' it moves to the first file name in the
selected window. I don't understand how 'set-window-configuration' restores
the selected window's point.

> To confirm, try with the upper window selected instead.

Here is when the upper window is selected, but still it moves to (point-max)
in non-selected window:

(progn (dired "/tmp")
       (dired-other-window "/tmp") (other-window 1)
       (let ((w-c (current-window-configuration))
	     (p-m (point-marker)))
	 (view-emacs-todo) (delete-other-windows)
	 (with-current-buffer (get-buffer "tmp")
	   (revert-buffer))
	 (set-window-configuration w-c)))




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 27 Dec 2018 09:38:03 +0000
Resent-Message-ID: <handler.33871.B33871.154590345125009 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.154590345125009
          (code B ref 33871); Thu, 27 Dec 2018 09:38:03 +0000
Received: (at 33871) by debbugs.gnu.org; 27 Dec 2018 09:37:31 +0000
Received: from localhost ([127.0.0.1]:38178 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcS6c-0006VI-Ml
	for submit <at> debbugs.gnu.org; Thu, 27 Dec 2018 04:37:30 -0500
Received: from mout.gmx.net ([212.227.15.15]:46409)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1gcS6a-0006V3-ON
 for 33871 <at> debbugs.gnu.org; Thu, 27 Dec 2018 04:37:29 -0500
Received: from [192.168.1.101] ([46.125.250.89]) by mail.gmx.com (mrgmx001
 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MDQp3-1gZQlx1cZp-00Gtj3; Thu, 27
 Dec 2018 10:37:20 +0100
Message-ID: <5C249D48.1020608@HIDDEN>
Date: Thu, 27 Dec 2018 10:37:12 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
References: <87bm59mglk.fsf@HIDDEN> <5C234D27.40309@HIDDEN>
 <87y38bhm6i.fsf@HIDDEN>
In-Reply-To: <87y38bhm6i.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:kcPVmbum8ZW3244C128YcnUYmQ5g8LeW3diS8xmdv4FNqgmhBbY
 xqCigjkIhpBBX9VzPFxfNW/ICZrPbiY4Dfm0vqXG6aVpfZc78QCfoSYOHNsJwDqAIXGHj0s
 2Eu6snAwoUF3tMKj/GvjD4hYUW1yOhCa2HZXUGBPgpFLEOcsi2m/u5wedUkAltTJl9hizZT
 uzqM90jEK3UjbGaC2dLFA==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:iYTK/r0Hits=:A+GADu+RbOo07/8daGYQQ9
 HxIK+ZFWYbPVX5z7wCQsukZYHgSWO7YWugLVSIA6bSnlzecXE8v19/agnI+4cZWqWx8OOyCDx
 eA07FblzmBJ3cF2fE2TUHwmOwDGhfjInCquu3fBBGEn2szAEb6htw+1v0B8M4LHCRM25EuAvF
 jBg4Y00usQ+CQkyM4fhQK1nGwLUscUETumoJbojf4Us2hwFUoWvC6lFpZdaUmco6KGVoElR9m
 msEEAaLWvj62bie15lHshjwSSwTwT5oGp7y5I/yUUX7lnjoqtzS3/ozUUg5EJnYGEr5eDxTQm
 WgB1BaBFHogpm2/GaLpWMaxfV9TNeLbeEmb8WLip9nA9qzlHee7slDBZBdqRu7HHOMQsSC0Wy
 cWFJ4AgHKB4t20nRCode4ALW75bTC6Yeem6AUEmorYR+YQeFzbbPv100CQ6mSwxWyW/uB1P6F
 aklHCZiS3ZzbvIZaOiWJhArq5BHnnbx1Y7i3iwnzge5qE0GzpGrlBT8c6sl4zff+zlpHd9yG3
 OOlZ7y6JID9d4FRy2lMEH9zKIOu/nvbSmdRFfH4Fm00zZT/020KbZYJiPn5XRLZabmG/0yuSG
 U7Im1/mWovqg0n7NDb0Nfw1gnw7tY+bvRsID1SJH/KhCogsWzePpKV9p/fTeJj9xAMCxmDey8
 3luBUgm1KvWrRFrQBz/FKRWigmMjJ3/oYJLbyuJcUBcf0M9sQ1fG/TuNfT4dMBYY9IXoErUQK
 J2zcNXtgYHT3vlU0JP+aO9HAdeS4t9oRzYpIgd+D6hAqEbGB5wFQE/1tfuLg+SuuCuZIfGerM
 NDlsp9AUskaCJGPzS9SLVIyO1VoxAsuZyt2qa4nEWYCm0wTfk5/htdZiN2tI6Y3TOnmpfc8om
 K6Df4y8pBF6kiTCDTeeEkSyxmxopdt50nDUmn15PDkUMyq3UsFF2W4vADj0XfTddBNFa6r0UR
 PQqnNrGFl4A==
X-Spam-Score: 0.8 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.2 (/)

 > I see that without `goto-char' it moves to the first file name in the
 > selected window.

I see the same here.  In the selected window only, though.

 > I don't understand how 'set-window-configuration' restores
 > the selected window's point.

 From the buffer's point as established by the revert function of dired
for buffers not displayed anywhere.

 >> To confirm, try with the upper window selected instead.
 >
 > Here is when the upper window is selected, but still it moves to (point-max)
 > in non-selected window:
 >
 > (progn (dired "/tmp")
 >         (dired-other-window "/tmp") (other-window 1)
 >         (let ((w-c (current-window-configuration))
 > 	     (p-m (point-marker)))
 > 	 (view-emacs-todo) (delete-other-windows)
 > 	 (with-current-buffer (get-buffer "tmp")
 > 	   (revert-buffer))
 > 	 (set-window-configuration w-c)))

In every non-selected window.  Try with as many windows as you want.
Only the selected window is handled separately.

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 27 Dec 2018 21:46:02 +0000
Resent-Message-ID: <handler.33871.B33871.154594715223839 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.154594715223839
          (code B ref 33871); Thu, 27 Dec 2018 21:46:02 +0000
Received: (at 33871) by debbugs.gnu.org; 27 Dec 2018 21:45:52 +0000
Received: from localhost ([127.0.0.1]:39589 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcdTU-0006CQ-4Z
	for submit <at> debbugs.gnu.org; Thu, 27 Dec 2018 16:45:52 -0500
Received: from common.maple.relay.mailchannels.net ([23.83.214.38]:42174)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1gcdTS-0006CH-4I
 for 33871 <at> debbugs.gnu.org; Thu, 27 Dec 2018 16:45:51 -0500
X-Sender-Id: dreamhost|x-authsender|jurta@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id 92CE1283AB3;
 Thu, 27 Dec 2018 21:45:48 +0000 (UTC)
Received: from pdx1-sub0-mail-a68.g.dreamhost.com (unknown [100.96.29.126])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id 592A12838BB;
 Thu, 27 Dec 2018 21:45:48 +0000 (UTC)
X-Sender-Id: dreamhost|x-authsender|jurta@HIDDEN
Received: from pdx1-sub0-mail-a68.g.dreamhost.com (pop.dreamhost.com
 [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384)
 by 0.0.0.0:2500 (trex/5.16.2); Thu, 27 Dec 2018 21:45:48 +0000
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|jurta@HIDDEN
X-MailChannels-Auth-Id: dreamhost
X-Harmony-Descriptive: 0e45630b01959d8b_1545947148440_2197610677
X-MC-Loop-Signature: 1545947148440:3235524345
X-MC-Ingress-Time: 1545947148439
Received: from pdx1-sub0-mail-a68.g.dreamhost.com (localhost [127.0.0.1])
 by pdx1-sub0-mail-a68.g.dreamhost.com (Postfix) with ESMTP id E6C557FD07;
 Thu, 27 Dec 2018 13:45:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc
 :subject:references:date:in-reply-to:message-id:mime-version
 :content-type; s=linkov.net; bh=ynHmA367ySaZGM4dX6HlA1ihAvA=; b=
 mtsbFCMRgCbt8DrK/22FAHFBaYMST6eFG2Y9e0QxMokZN3LVcXid5vRVRkOb3lXg
 +6p+s9SUXBAhsJ0GXxSxBDlorLBuRbEoykXmhvy9YMXcq7eIUuu3vqmU+M0siLij
 Jid3ulQ/CILO/sZgQlYAV3LCjxyQN4Alk5snHEPu/dY=
Received: from mail.jurta.org (m91-129-108-193.cust.tele2.ee [91.129.108.193])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256
 bits)) (No client certificate requested)
 (Authenticated sender: jurta@HIDDEN)
 by pdx1-sub0-mail-a68.g.dreamhost.com (Postfix) with ESMTPSA id 6071C7FCFE;
 Thu, 27 Dec 2018 13:45:45 -0800 (PST)
X-DH-BACKEND: pdx1-sub0-mail-a68
From: Juri Linkov <juri@HIDDEN>
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <5C234D27.40309@HIDDEN>
 <87y38bhm6i.fsf@HIDDEN> <5C249D48.1020608@HIDDEN>
Date: Thu, 27 Dec 2018 23:34:08 +0200
In-Reply-To: <5C249D48.1020608@HIDDEN> (martin rudalics's message of "Thu, 27
 Dec 2018 10:37:12 +0100")
Message-ID: <87efa21wof.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-VR-OUT-STATUS: OK
X-VR-OUT-SCORE: -100
X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrtdefgdelfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtkedrudelfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdekrdduleefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtoheprhhuuggrlhhitghssehgmhigrdgrthenucevlhhushhtvghrufhiiigvpedt
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>> I see that without `goto-char' it moves to the first file name in the
>> selected window.
>
> I see the same here.  In the selected window only, though.
>
>> I don't understand how 'set-window-configuration' restores
>> the selected window's point.
>
> From the buffer's point as established by the revert function of dired
> for buffers not displayed anywhere.

So the revert function doesn't use markers?  Maybe then
set-window-configuration should not use markers too?

>>> To confirm, try with the upper window selected instead.
>>
>> Here is when the upper window is selected, but still it moves to (point-max)
>> in non-selected window:
>>
>> (progn (dired "/tmp")
>>         (dired-other-window "/tmp") (other-window 1)
>>         (let ((w-c (current-window-configuration))
>> 	     (p-m (point-marker)))
>> 	 (view-emacs-todo) (delete-other-windows)
>> 	 (with-current-buffer (get-buffer "tmp")
>> 	   (revert-buffer))
>> 	 (set-window-configuration w-c)))
>
> In every non-selected window.  Try with as many windows as you want.
> Only the selected window is handled separately.

A bug?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 28 Dec 2018 08:35:02 +0000
Resent-Message-ID: <handler.33871.B33871.154598609427015 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.154598609427015
          (code B ref 33871); Fri, 28 Dec 2018 08:35:02 +0000
Received: (at 33871) by debbugs.gnu.org; 28 Dec 2018 08:34:54 +0000
Received: from localhost ([127.0.0.1]:39700 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcnba-00071f-4Z
	for submit <at> debbugs.gnu.org; Fri, 28 Dec 2018 03:34:54 -0500
Received: from mout.gmx.net ([212.227.17.22]:48623)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1gcnbW-00071J-PG
 for 33871 <at> debbugs.gnu.org; Fri, 28 Dec 2018 03:34:51 -0500
Received: from [192.168.1.101] ([46.125.249.76]) by mail.gmx.com (mrgmx103
 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LqQTl-1hG0Ez1RTd-00e2XI; Fri, 28
 Dec 2018 09:34:40 +0100
Message-ID: <5C25E016.3050808@HIDDEN>
Date: Fri, 28 Dec 2018 09:34:30 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
References: <87bm59mglk.fsf@HIDDEN>
 <5C234D27.40309@HIDDEN>	<87y38bhm6i.fsf@HIDDEN>
 <5C249D48.1020608@HIDDEN> <87efa21wof.fsf@HIDDEN>
In-Reply-To: <87efa21wof.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:Z1064N0LZLP0THgujkNpfZXkEUjRXI0MFSIdqH7uHH+p7JrEcmR
 Ambq7wVnlAo5RC1pyRz6uWbse5hkMGPwK07PSbqzgP3kYFJCJBziG2clmAWq66HIDHiXtNz
 kZZUWq6SJ7Pj+oJWtIxOH6eqBO3QRLpnsKQDky28ENVNLYiu2abD0f9Z+K0+4mMj9Z+eRav
 yrKs0O6jgl4eXgTlK3H4Q==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:hmdDSjZ0Msk=:g/dOeUR+nnG7o6HA0BQbov
 EgcItlDb7AZR9xlwXeusw2auEO43XIn9SxEMNu2qK1Y6FGL89qkvXvSkND94DBw6c53ni7VyK
 bzzgVhSmmohHGv6WKzhbLp7Xy/LRtP4okoBZkc1tx1iYX5c3F2dpzAU0dcAaiwK+egJlY4DUp
 ugXFlUE2dYTC5IsnNlj3OOqy2c5qf1oeywJi2L4M0L0Z1IROePaQMAIXUe13pYHkn+afh5QJd
 VeTC/zKYwlP5pcc0DFEaXvuXY+/p2BJ75TE3tBpAMUj/ArEy8TqT8zCN58HNq0r2a/TGUg4El
 w3G2CCxnK7o9DnBScaLJv/pW0mKwDNBPJfeSNW8QhLqzopSrkxeLR3dCdEyudh6oYplNiY8PX
 g/9ZDYXzOE8YJm/RR0+B5xDtKBedTtjHlNTZut001dr1d99FK0KM9yCET3zDyfoK1bfXCmPrN
 ICiqQ7ReAG1XzeG1EVsof7L07T6RdfMj9CWDYQtIR1oNoLm+66y/De9wDv3zksxpYcGCUln9k
 EKQYj9l6eNj+0GnmGynYKG5BAi03HkTmBcxuOp2nVIYrVMWmik82tiY8wvtAdagjsq85zm68w
 KTRR2dpObaYUcE59E8ssAurq9EPhAbQdAWjTYL8iGE45gJreyCX1K9t5+K5GRb9FimzoDR/0V
 Or9Ek2NcLYD674rW94sGcQpyjig93MZrVxT/w99YtiHpglINN9/YyeiiYCfvOeFpwcs+13ymH
 lT2YfJESHmKNScqXe9pit7IypLmp7isTXye1yTLwoeIs+b1yto8U9NEfUZg99Zzyrd3WpY9Oe
 LeTkXxJTvgYtVpTJbvB3TXikUvfonoWe+jShYqUCxSB5HfVqr1PmuW7uWqL1lG44ty6FElrY6
 5VXgBn/M9aIgwAm3asgmqrYZLFcLo0PgvB2RZnMcSYUiobYKpze6SD4CGjSrAJfIPBa8OKkdZ
 GMS6cs14yVQ==
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > So the revert function doesn't use markers?  Maybe then
 > set-window-configuration should not use markers too?

'dired-revert' is spcecial.  There's nothing we can conclude from it.

 >>> Here is when the upper window is selected, but still it moves to (point-max)
 >>> in non-selected window:
 >>>
 >>> (progn (dired "/tmp")
 >>>          (dired-other-window "/tmp") (other-window 1)
 >>>          (let ((w-c (current-window-configuration))
 >>> 	     (p-m (point-marker)))
 >>> 	 (view-emacs-todo) (delete-other-windows)
 >>> 	 (with-current-buffer (get-buffer "tmp")
 >>> 	   (revert-buffer))
 >>> 	 (set-window-configuration w-c)))
 >>
 >> In every non-selected window.  Try with as many windows as you want.
 >> Only the selected window is handled separately.
 >
 > A bug?

As I suggested earlier we can use the position of the buffer's point
in every window regardless of whether it currently shows the buffer or
we later switch to the buffer in it.  But this is not what we usually
want when using multiple windows: We usually want them to show
different portions of the same buffer.

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
In-Reply-To: <87bm59mglk.fsf@HIDDEN>
Resent-From: Markus Triska <triska@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 29 Dec 2018 11:27:02 +0000
Resent-Message-ID: <handler.33871.B.15460827939021 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 33871 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.15460827939021
          (code B ref -1); Sat, 29 Dec 2018 11:27:02 +0000
Received: (at submit) by debbugs.gnu.org; 29 Dec 2018 11:26:33 +0000
Received: from localhost ([127.0.0.1]:40876 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gdClF-0002LQ-5L
	for submit <at> debbugs.gnu.org; Sat, 29 Dec 2018 06:26:33 -0500
Received: from eggs.gnu.org ([208.118.235.92]:45526)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1gdClD-0002LC-Ci
 for submit <at> debbugs.gnu.org; Sat, 29 Dec 2018 06:26:31 -0500
Received: from lists.gnu.org ([208.118.235.17]:43013)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1gdCl7-0007ES-Mr
 for submit <at> debbugs.gnu.org; Sat, 29 Dec 2018 06:26:25 -0500
Received: from eggs.gnu.org ([208.118.235.92]:55176)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1gdCl2-0000LK-Fj
 for bug-gnu-emacs@HIDDEN; Sat, 29 Dec 2018 06:26:25 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: *
X-Spam-Status: No, score=1.6 required=5.0 tests=BAYES_50,RDNS_NONE
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1gdCeX-0001C7-AO
 for bug-gnu-emacs@HIDDEN; Sat, 29 Dec 2018 06:20:13 -0500
Received: from [195.159.176.226] (port=41642 helo=blaine.gmane.org)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1gdCeW-00013a-GX
 for bug-gnu-emacs@HIDDEN; Sat, 29 Dec 2018 06:19:37 -0500
Received: from list by blaine.gmane.org with local (Exim 4.84_2)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1gdCcH-0006cK-6O
 for bug-gnu-emacs@HIDDEN; Sat, 29 Dec 2018 12:17:17 +0100
X-Injected-Via-Gmane: http://gmane.org/
From: Markus Triska <triska@HIDDEN>
Date: Sat, 29 Dec 2018 12:19:21 +0100
Organization: man
Lines: 20
Message-ID: <m2zhsooa12.fsf@HIDDEN>
References: <87bm59mglk.fsf@HIDDEN> <5C234D27.40309@HIDDEN>
 <87y38bhm6i.fsf@HIDDEN> <5C249D48.1020608@HIDDEN>
 <87efa21wof.fsf@HIDDEN> <5C25E016.3050808@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain
X-Complaints-To: usenet@HIDDEN
User-Agent: Emacs/26.1
Cancel-Lock: sha1:w7ERwO2I7DfqJXs4rHPNumgldro=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-Received-From: 195.159.176.226
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: -5.0 (-----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

martin rudalics <rudalics@HIDDEN> writes:

> As I suggested earlier we can use the position of the buffer's point
> in every window regardless of whether it currently shows the buffer or
> we later switch to the buffer in it.  But this is not what we usually
> want when using multiple windows: We usually want them to show
> different portions of the same buffer.

In the cases I faced, I found it a drawback that the current buffer is
treated differently than the others by current-window-configuration:

Suppose it did not make such an exception. Then it would be quite easy
to manually implement exceptional behaviour for the current buffer. But
the converse is not so easy: It is harder to manually obtain the desired
behaviour if we *want* the current buffer to be treated like the others,
when the function already treats it differently. If it didn't, then a
simple save-excursion, or a similar mechanisms, around restoring the
window configuration could ostensibly restore the state for all buffers
except the current one, resulting in the same behaviour that we get now.
At least that was my impression when using window configurations.





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 29 Dec 2018 18:20:01 +0000
Resent-Message-ID: <handler.33871.B33871.154610754224518 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Markus Triska <triska@HIDDEN>, 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.154610754224518
          (code B ref 33871); Sat, 29 Dec 2018 18:20:01 +0000
Received: (at 33871) by debbugs.gnu.org; 29 Dec 2018 18:19:02 +0000
Received: from localhost ([127.0.0.1]:41644 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gdJCO-0006N6-KE
	for submit <at> debbugs.gnu.org; Sat, 29 Dec 2018 13:19:00 -0500
Received: from mout.gmx.net ([212.227.15.18]:40725)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1gdJCM-0006Mt-Om
 for 33871 <at> debbugs.gnu.org; Sat, 29 Dec 2018 13:18:59 -0500
Received: from [192.168.1.101] ([212.95.5.17]) by mail.gmx.com (mrgmx001
 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LtJAR-1hMZGR1N6Z-012nOb; Sat, 29
 Dec 2018 19:18:52 +0100
Message-ID: <5C27BA8D.1070309@HIDDEN>
Date: Sat, 29 Dec 2018 19:18:53 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
References: <87bm59mglk.fsf@HIDDEN>
 <5C234D27.40309@HIDDEN>	<87y38bhm6i.fsf@HIDDEN>
 <5C249D48.1020608@HIDDEN>	<87efa21wof.fsf@HIDDEN>
 <5C25E016.3050808@HIDDEN> <m2zhsooa12.fsf@HIDDEN>
In-Reply-To: <m2zhsooa12.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:D9eJVSYhJTcswQKEAJeOl6qvY8dprPq6Xi/zVkrGPT4/CI3FNYT
 ctf92vLG2v7pExnUobJRzCCW3WezwhsbcEdpvWDTZpIgt2SEz/hRmVj86jZLmp6bvJp8o5o
 NuWKxqNp6YLb73YaVSohlc+4XmfoV4VBTGCi6VGToHhvTWfD9CCq7Gfmy35jqA7JxNuCVN9
 xY+1j6WhNxCOlTVj++xPw==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:7RmuRDVXIlU=:gpLCKbwxtEb3HGUbRPxKCa
 pRpUn/R9Vk4efPdxUtV2smkilttHZFDSsKQqSnqN1LlrDE0qvJLqPwjOb8sRBPdqlCJAouewm
 AS7+X9z8dEK9dXvoYMZwi8RJp4oZTlEs1HxOEPvPm1AIVXo7d5unVPrtMvAIUYmoQm9RRMhhs
 ncdmcNHXA7hI6jw5DwMAqA4iTMuL4KLOhGhm0XZ723QQKVQHpiEOePGoxzqJiiEF3Y/Hwlc9X
 pH2/ztNEnzLuMleEKbbbI1f+IgC5xuXCuA0lxaBd3UP2GIQsF4p5zJE4LW6J6CVa0CNaeRZ11
 BnAtcAioNccqCtE8hSKdGI23f24BTbxsdjC4Wzo4GXhrjL/yvPqqNQXqaSyEY143McbaxdQ6f
 Gv/EJBzvEpgcidEfWOUBknHzgGzdFZ7jpjllQfEDp1tZ7bta7ssLY+/JCZwl+iDgqxzxwDI5U
 VNUEKRsFAvKWs0yDelxM3h4v1drLoPsHfMgnWN1BOiFJSIT1APthiwOJ8P8CewrtMpMEArYaq
 YBAkIIIEahCNKkZ5mZZrGl2w+Pl8SCBgO0wUT6HUqAUXRJp2/HYQYZUTlWsLxLBVTORcO7tWu
 LX8wEyIZNfcDUWe7fBc+itZKxWTQTAkr7q5VGOMVN1fbMAgbxZLpg8uo8Qy4vzrgpoZzNWt1+
 9L/DeJ6r8D/aAia4cWXoMTiqnixURCeWo1+q4r4LlT822SOxXdGDjSoxh7msicCYzNl+za067
 Eqk5agHc06+U61R1O0ebleY7LOKH3CBMQdXzWFEUPeKeWt10adgxLh4RRJuPJyOYGW1VjTuP3
 KIpJomLO+Sus9OwidiGcDkjm/wLqyJb6Fjes75pyp6ikyf9h4yAO2iDOu4hgx7QyQK581n3Fs
 evndUiem8Z9BegwC44hPWYFytRqMow49cpo4sBVSd/PEAeTLNtMAVyrFRYKja/
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > In the cases I faced, I found it a drawback that the current buffer is
 > treated differently than the others by current-window-configuration:

I'm not sure what precisely you mean here.  'save-window-excursion'
saves and restores the current buffer so that the restored state
replicates the saved state as closely as possible.  Hence, the buffer
current when the old configuration was saved should be also current
after the old configuration has been restored, regardless of whether
it is the buffer assigned to any of the selected windows.

If you allude to the

   As a special exception, the window
   configuration does not record the value of point in the selected window
   for the current buffer.

then this behavior is provided for historical reasons AFAICT.  Most
applications using a window excursion probably did not like the cursor
jump back to the old location.

 > Suppose it did not make such an exception. Then it would be quite easy
 > to manually implement exceptional behaviour for the current buffer. But
 > the converse is not so easy: It is harder to manually obtain the desired
 > behaviour if we *want* the current buffer to be treated like the others,
 > when the function already treats it differently. If it didn't, then a
 > simple save-excursion, or a similar mechanisms, around restoring the
 > window configuration could ostensibly restore the state for all buffers
 > except the current one, resulting in the same behaviour that we get now.
 > At least that was my impression when using window configurations.

It depends on what you want to handle manually.  Note that if you do
not save any additional information separately, a window configuration
by itself does not give you any clue as to which buffer was current or
which window was selected at the time it was saved.

What we could do is to give 'set-window-configuration' an additional
argument which, for example, would allow to restore the selected
window's point to its saved position.

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 29 Dec 2018 23:25:02 +0000
Resent-Message-ID: <handler.33871.B33871.154612587532039 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.154612587532039
          (code B ref 33871); Sat, 29 Dec 2018 23:25:02 +0000
Received: (at 33871) by debbugs.gnu.org; 29 Dec 2018 23:24:35 +0000
Received: from localhost ([127.0.0.1]:41710 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gdNy7-0008Kh-BC
	for submit <at> debbugs.gnu.org; Sat, 29 Dec 2018 18:24:35 -0500
Received: from goldenrod.birch.relay.mailchannels.net ([23.83.209.74]:4760)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1gdNy2-0008KM-SN
 for 33871 <at> debbugs.gnu.org; Sat, 29 Dec 2018 18:24:31 -0500
X-Sender-Id: dreamhost|x-authsender|jurta@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id 9A259123BE0;
 Sat, 29 Dec 2018 23:24:29 +0000 (UTC)
Received: from pdx1-sub0-mail-a25.g.dreamhost.com (unknown [100.96.11.179])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id 3EED2123B8A;
 Sat, 29 Dec 2018 23:24:29 +0000 (UTC)
X-Sender-Id: dreamhost|x-authsender|jurta@HIDDEN
Received: from pdx1-sub0-mail-a25.g.dreamhost.com (pop.dreamhost.com
 [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384)
 by 0.0.0.0:2500 (trex/5.16.2); Sat, 29 Dec 2018 23:24:29 +0000
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|jurta@HIDDEN
X-MailChannels-Auth-Id: dreamhost
X-Tank-Thoughtful: 0a25a1c53239b44c_1546125869451_3205600617
X-MC-Loop-Signature: 1546125869451:1130413363
X-MC-Ingress-Time: 1546125869451
Received: from pdx1-sub0-mail-a25.g.dreamhost.com (localhost [127.0.0.1])
 by pdx1-sub0-mail-a25.g.dreamhost.com (Postfix) with ESMTP id D09BF819C6;
 Sat, 29 Dec 2018 15:24:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc
 :subject:references:date:in-reply-to:message-id:mime-version
 :content-type; s=linkov.net; bh=s8PHV+tcHqYxZRrWFRkcp4ghzIo=; b=
 QQloEPCpPpSa5TzfMulLIG27G/2axQjxrcDgzp/5LiE1yhbRXWNPJr7bzQ8c7ggC
 Z8kDKqYuTKqXDe7KNmuJwtHnM/U6HGAVBto+y+YNIU6bmxE6M/6qLbKMPL1avsfx
 8n++Ld3z6rML9X/Lud0VC8L2sXy5zTVaEs1mucFQmJk=
Received: from mail.jurta.org (m91-129-108-193.cust.tele2.ee [91.129.108.193])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256
 bits)) (No client certificate requested)
 (Authenticated sender: jurta@HIDDEN)
 by pdx1-sub0-mail-a25.g.dreamhost.com (Postfix) with ESMTPSA id B742E819C7;
 Sat, 29 Dec 2018 15:24:27 -0800 (PST)
X-DH-BACKEND: pdx1-sub0-mail-a25
From: Juri Linkov <juri@HIDDEN>
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <5C234D27.40309@HIDDEN>
 <87y38bhm6i.fsf@HIDDEN> <5C249D48.1020608@HIDDEN>
 <87efa21wof.fsf@HIDDEN> <5C25E016.3050808@HIDDEN>
Date: Sun, 30 Dec 2018 01:21:05 +0200
In-Reply-To: <5C25E016.3050808@HIDDEN> (martin rudalics's message of "Fri, 28
 Dec 2018 09:34:30 +0100")
Message-ID: <87muonyl4b.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-VR-OUT-STATUS: OK
X-VR-OUT-SCORE: -100
X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrtdelgddutdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtkedrudelfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdekrdduleefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtoheprhhuuggrlhhitghssehgmhigrdgrthenucevlhhushhtvghrufhiiigvpedv
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>> So the revert function doesn't use markers?  Maybe then
>> set-window-configuration should not use markers too?
>
> 'dired-revert' is special.  There's nothing we can conclude from it.

image-revert is another special, as indicated by bug#33631

>>>> Here is when the upper window is selected, but still it moves to (point-max)
>>>> in non-selected window:
>>>>
>>>> (progn (dired "/tmp")
>>>>          (dired-other-window "/tmp") (other-window 1)
>>>>          (let ((w-c (current-window-configuration))
>>>> 	     (p-m (point-marker)))
>>>> 	 (view-emacs-todo) (delete-other-windows)
>>>> 	 (with-current-buffer (get-buffer "tmp")
>>>> 	   (revert-buffer))
>>>> 	 (set-window-configuration w-c)))
>>>
>>> In every non-selected window.  Try with as many windows as you want.
>>> Only the selected window is handled separately.
>>
>> A bug?

Do you know why it currently moves point to the end of the buffer
in non-selected windows.  I don't understand what causes this behavior.

> As I suggested earlier we can use the position of the buffer's point
> in every window regardless of whether it currently shows the buffer or
> we later switch to the buffer in it.  But this is not what we usually
> want when using multiple windows: We usually want them to show
> different portions of the same buffer.

Yes, better to keep every window's own point.  Since usually I save
the selected window's point along with the window configuration, in e.g.

((window-configuration-1 selected-window-point)
 (window-configuration-2 selected-window-point)
 ...)

this could be extended to save a mapping of all windows points, e.g.

((window-configuration-1 ((window-a point-a) (window-b point-b) ...))
 (window-configuration-2 ...)
 ...)


But it's not a general solution.  A general solution would be to save
such metadata in the window configuration itself.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 30 Dec 2018 09:54:02 +0000
Resent-Message-ID: <handler.33871.B33871.154616359011724 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.154616359011724
          (code B ref 33871); Sun, 30 Dec 2018 09:54:02 +0000
Received: (at 33871) by debbugs.gnu.org; 30 Dec 2018 09:53:10 +0000
Received: from localhost ([127.0.0.1]:41833 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gdXmP-000332-Tm
	for submit <at> debbugs.gnu.org; Sun, 30 Dec 2018 04:53:10 -0500
Received: from mout.gmx.net ([212.227.17.20]:45785)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1gdXmO-00032m-Oc
 for 33871 <at> debbugs.gnu.org; Sun, 30 Dec 2018 04:53:09 -0500
Received: from [192.168.1.101] ([213.162.73.190]) by mail.gmx.com (mrgmx103
 [212.227.17.168]) with ESMTPSA (Nemesis) id 0McluX-1gvU8T0bdx-00Hx83; Sun, 30
 Dec 2018 10:53:00 +0100
Message-ID: <5C28957A.9050609@HIDDEN>
Date: Sun, 30 Dec 2018 10:52:58 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
References: <87bm59mglk.fsf@HIDDEN>
 <5C234D27.40309@HIDDEN>	<87y38bhm6i.fsf@HIDDEN>
 <5C249D48.1020608@HIDDEN>	<87efa21wof.fsf@HIDDEN>
 <5C25E016.3050808@HIDDEN> <87muonyl4b.fsf@HIDDEN>
In-Reply-To: <87muonyl4b.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:19uP0Mn5SYekrwcUXDyOFG/KYWeM0o0jWLVX+h3NNAsBbFnHLtj
 wCZRcXymkAgw3vdWHJIqLJ+RdcxnuHbfNxdA54COq0h9AIhYNXBSqQnmtT5odzq9op5NFaS
 c1fH5scZAqt3XpJmm0LI2e6VhXYpXURbZ4pkESJasB7vXzSR/kJ/3QsTvsR0kr5Vf0aP449
 XFqr+YyC2bP0jJIB8sqsg==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:qRv0NyfT6gk=:xAH+z8XqJPeLRRvXjOvWXm
 S9RJT7HYHOwTx9AJwtxDgWeWzHIdT8/btfwM4kPJrkDi182WXjwKHS4SOoi62hREGpQkqoIdA
 3SAcXuWYUOm/wqceddmFj852OX2e+Sg7toXYTBjvITnvdh7fbm3OoPxdU/C6SiHRsjFoyszkZ
 qUMELdOoZcA9oUq0yuFdfZi/4oqdJJgLNjFqps2VnrQM0uDi6pIbuZu2NdfNrbHwckUn2HW+S
 SFIc2avCdPH6qIEOIyx1ctubPgK+S07uvOdBIJxERJEUoTSExBPpk0AdEowVXw5gqgB/Sidmd
 ni0OCrxtjK5FE8tScYIDr9DgcbIYURAj2+gLarvFqYjatm1PUBKIRngMvDRewZs467nBB0aS5
 e+cqKEnz7cvmoy+sBmwjP6NEZ7MKcbZ8fRnCCVkWXT5DNYuLbwOz0VSexlsoE6brSywG3Jkqx
 GatDkHDHma9OBcCKuJ6R42jhjVQm/RlbpdqCMcT9cBdhbVwAxrG++gQl5jMK7i8b9qjlKt3FL
 EI00hQK+yOVBMxZ/+Qi2bB9dgcS3TcKvQtfzybgd84rPyMyAudkfV9AytxZF5wDoGz/KLlTzt
 XfEjlzA2d7NKYd3OHlspkJ+XR0C1ViPdRsBF5x8+bmaqsChDnRCRbka8O0l2q9zAJVrpK3F6x
 S7hWmmgCeWK0BuUceyzsiu47NfjnIHT5ixv437AsmZLjpZCm6POflXRywE200YZ2xO/jF4Iy3
 9VE+3Zdt5qNLWeCMd1fXgCZTVFK5XQb/Hs0HCX7E5k3npra+D0iEI6VHOlz6VCCUI5aX5LE7p
 n1SiGvEoL9029auRqBcX5+tuuLHKr87AAvxo3ikHfkQLE4tc9M4UiCnD3+Yz4AhNR8eCJADXI
 8gxCJs6E6bjyJ0HvI27WS9tYyb5oMisyQwHSDKQRr4mwcpKFMPAUW9fgfceMK/
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > image-revert is another special, as indicated by bug#33631

But there the position of point or that of its window has no impact, I
presume.

 > Do you know why it currently moves point to the end of the buffer
 > in non-selected windows.  I don't understand what causes this behavior.

I nowlooked into it.  It's a bug caused by

	  XMARKER (p->pointm)->insertion_type
	    = !NILP (buffer_local_value /* Don't signal error if void.  */
		     (Qwindow_point_insertion_type, w->contents));

and the value of

buffer_local_value (Qwindow_point_insertion_type, w->contents)

is unbound and not nil.  I have to fix that.

 >> As I suggested earlier we can use the position of the buffer's point
 >> in every window regardless of whether it currently shows the buffer or
 >> we later switch to the buffer in it.  But this is not what we usually
 >> want when using multiple windows: We usually want them to show
 >> different portions of the same buffer.
 >
 > Yes, better to keep every window's own point.  Since usually I save
 > the selected window's point along with the window configuration,

As number or as marker?

 > in e.g.
 >
 > ((window-configuration-1 selected-window-point)
 >   (window-configuration-2 selected-window-point)
 >   ...)
 >
 > this could be extended to save a mapping of all windows points, e.g.
 >
 > ((window-configuration-1 ((window-a point-a) (window-b point-b) ...))
 >   (window-configuration-2 ...)
 >   ...)
 >
 >
 > But it's not a general solution.  A general solution would be to save
 > such metadata in the window configuration itself.

But a configuration saves the point of each window, for the selected
one it stores the point of that window's buffer.  Is it just because
you want to be able to retrieve those values?  Or what am I missing?

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 30 Dec 2018 14:58:02 +0000
Resent-Message-ID: <handler.33871.B33871.154618187817216 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.154618187817216
          (code B ref 33871); Sun, 30 Dec 2018 14:58:02 +0000
Received: (at 33871) by debbugs.gnu.org; 30 Dec 2018 14:57:58 +0000
Received: from localhost ([127.0.0.1]:42532 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gdcXO-0004Ta-9G
	for submit <at> debbugs.gnu.org; Sun, 30 Dec 2018 09:57:58 -0500
Received: from mout.gmx.net ([212.227.15.18]:35053)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1gdcXI-0004TD-9r
 for 33871 <at> debbugs.gnu.org; Sun, 30 Dec 2018 09:57:56 -0500
Received: from [192.168.1.101] ([46.125.250.79]) by mail.gmx.com (mrgmx003
 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MeP5b-1gzFST2ael-00QEPI; Sun, 30
 Dec 2018 15:57:42 +0100
Message-ID: <5C28DCE4.3010002@HIDDEN>
Date: Sun, 30 Dec 2018 15:57:40 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
References: <87bm59mglk.fsf@HIDDEN>	<5C234D27.40309@HIDDEN>	<87y38bhm6i.fsf@HIDDEN>	<5C249D48.1020608@HIDDEN>	<87efa21wof.fsf@HIDDEN>	<5C25E016.3050808@HIDDEN>
 <87muonyl4b.fsf@HIDDEN> <5C28957A.9050609@HIDDEN>
In-Reply-To: <5C28957A.9050609@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:fRfUk2HibHGWTwx+CckTBzFJDh7MYGbTdBiwk9impEGOPQDOc7w
 AA/JD5NYkSuC6HnnfiDsV1MNwjRcwxS26XAhFugMzOOcjiqITmQqFzU5YhjXodBfWWUR5Mp
 5YuTCjBErtSoUvCw5XYSzjGI4XzrRAGBD/6WKrSNPdilthuyK2UAIzegGDJ6AccLfm+EVQv
 LumES5MCO2crc0O6q7RBQ==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:hDHCpQNCixw=:tldp4zu7kczDHr+muVriKM
 0CFEdGTu8M3F+kf4zTB0ESmoXeK/LXIMWvFDncZnl9oJ3lctvJkRlcs6EIKIFT0eAHq6Tgdso
 GSRrYxSdR6ePG6+LFwngGnnbLwe+jMmxnc3IFti/JzCFc3VhfG72etuIgkSgZKuoPFJVjLtcB
 EdUfbQJ/Hqfl0oPTOYQeOxU30dlxpoJNxjO8+XiKhdh4CxeWHxLE0C1khZ87lwMoK3Ez0vyU7
 ximtOSdDbLSefTdlUTCFx89KAXi2e9nzH5qqB88s9Z0FPLVW+r79Dit4BCXbjSxFlSysIwb5p
 I3YywkjQ8xocure/Tflalzs9wnbm33IH6YwF8suMUb6X0q0XudPUT1VPVsbFmoVTgJPTPC6Te
 VTJbxCParnxANqTQGmXTQLAauM7Img2dnzVtkpwnBneBudILZfSZCAghCPIBcbGCQdnOoMNm2
 vymF9t0RitR23fF4Z23zYvYyGd5LzTS3I9xtQ9lgjBy5GrnQTQotxPWCHn2Oqe/FHlERdNJf/
 GJYNyGcCEiEwf+gcCPNkwwoRpuxwMh1gN1UiBCZkbQ0tCrFYC+wORKRdGKuoktUkU1N1rW5cN
 jCPynZ/PrHgrG/PZkJrV1uScUqGu/Uj5+6Wc9+BIMmAR/7AG2KfTMSiBC2iA0gkAyNhNGnRkW
 XlRa542skNiRPbwpp10J58J0qvy4sG65ZDWGJzxbCKwr+X/r4cqj8bIN1C8qoV1aq/BNCdfu5
 ULkd3N0iRI0TpqfIuIb8i0+tvJ8A+JmTJi9m1G44BgHHi6b9bP4jISY28WHqaYqo08CoH8bi5
 2b9HePDERJs3X/D7dJOAGtfpMyUfodDMe8OfO0c+F9TXu16gDuz8KH8azcsNLtarXvgUNMP/m
 L+doBJZBOY+KCb38eZTESCTvIlzt3nXVS4RIDRj5Cc8+xaYBzMU8BR3sMbiiwuVNsh85vfril
 cz3lI4ZFkig==
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > I nowlooked into it.  It's a bug caused by
 >
 >        XMARKER (p->pointm)->insertion_type
 >          = !NILP (buffer_local_value /* Don't signal error if void.  */
 >               (Qwindow_point_insertion_type, w->contents));
 >
 > and the value of
 >
 > buffer_local_value (Qwindow_point_insertion_type, w->contents)
 >
 > is unbound and not nil.  I have to fix that.

I tried to fix that on master now.  Please have a look.

Thanks, martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 30 Dec 2018 21:32:01 +0000
Resent-Message-ID: <handler.33871.B33871.154620548124491 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.154620548124491
          (code B ref 33871); Sun, 30 Dec 2018 21:32:01 +0000
Received: (at 33871) by debbugs.gnu.org; 30 Dec 2018 21:31:21 +0000
Received: from localhost ([127.0.0.1]:42659 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gdig5-0006Mw-2c
	for submit <at> debbugs.gnu.org; Sun, 30 Dec 2018 16:31:21 -0500
Received: from common.maple.relay.mailchannels.net ([23.83.214.38]:21505)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1gdig3-0006Mk-Eh
 for 33871 <at> debbugs.gnu.org; Sun, 30 Dec 2018 16:31:20 -0500
X-Sender-Id: dreamhost|x-authsender|jurta@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id 40E2A682C5C;
 Sun, 30 Dec 2018 21:31:18 +0000 (UTC)
Received: from pdx1-sub0-mail-a69.g.dreamhost.com (unknown [100.96.20.98])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id EB04F68284A;
 Sun, 30 Dec 2018 21:31:17 +0000 (UTC)
X-Sender-Id: dreamhost|x-authsender|jurta@HIDDEN
Received: from pdx1-sub0-mail-a69.g.dreamhost.com (pop.dreamhost.com
 [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384)
 by 0.0.0.0:2500 (trex/5.16.2); Sun, 30 Dec 2018 21:31:18 +0000
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|jurta@HIDDEN
X-MailChannels-Auth-Id: dreamhost
X-Cellar-Tart: 5312d45b52ae3b59_1546205478105_2844402522
X-MC-Loop-Signature: 1546205478105:2055563711
X-MC-Ingress-Time: 1546205478104
Received: from pdx1-sub0-mail-a69.g.dreamhost.com (localhost [127.0.0.1])
 by pdx1-sub0-mail-a69.g.dreamhost.com (Postfix) with ESMTP id 8D02F803DA;
 Sun, 30 Dec 2018 13:31:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc
 :subject:references:date:in-reply-to:message-id:mime-version
 :content-type; s=linkov.net; bh=IOjFu1RcTFLblHXFwsLQw8b8wcA=; b=
 YkL+21Tzis369cuhHTUsXey+a1JZyVDKElIQtyhuOUK3K0fZQUs/wMCxHXwl+NRl
 v6DXdZfIfm0kK2BocYr+BfskkKtp/CKwv7M6smq0fpn5zbBx/G81oCN/X/jegoRg
 FtrOF5PXNEiAXU8toOzb+XRtnR7SqGG3m1ccdo/Gb/g=
Received: from mail.jurta.org (m91-129-108-193.cust.tele2.ee [91.129.108.193])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256
 bits)) (No client certificate requested)
 (Authenticated sender: jurta@HIDDEN)
 by pdx1-sub0-mail-a69.g.dreamhost.com (Postfix) with ESMTPSA id 02D51803D8;
 Sun, 30 Dec 2018 13:31:15 -0800 (PST)
X-DH-BACKEND: pdx1-sub0-mail-a69
From: Juri Linkov <juri@HIDDEN>
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <5C234D27.40309@HIDDEN>
 <87y38bhm6i.fsf@HIDDEN> <5C249D48.1020608@HIDDEN>
 <87efa21wof.fsf@HIDDEN> <5C25E016.3050808@HIDDEN>
 <87muonyl4b.fsf@HIDDEN> <5C28957A.9050609@HIDDEN>
Date: Sun, 30 Dec 2018 23:29:30 +0200
In-Reply-To: <5C28957A.9050609@HIDDEN> (martin rudalics's message of "Sun, 30
 Dec 2018 10:52:58 +0100")
Message-ID: <87k1jqaekl.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-VR-OUT-STATUS: OK
X-VR-OUT-SCORE: -100
X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledruddtgdduheduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdekrdduleefnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtkedrudelfedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgeptd
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>> image-revert is another special, as indicated by bug#33631
>
> But there the position of point or that of its window has no impact, I
> presume.

Yes, but there image-revert needs to know window dimensions
when the buffer is not displayed in a window - a situation
similar to dired-revert when buffer's windows are in a window
configuration.

>> Do you know why it currently moves point to the end of the buffer
>> in non-selected windows.  I don't understand what causes this behavior.
>
> I nowlooked into it.  It's a bug caused by
>
> 	  XMARKER (p->pointm)->insertion_type
> 	    = !NILP (buffer_local_value /* Don't signal error if void.  */
> 		     (Qwindow_point_insertion_type, w->contents));
>
> and the value of
>
> buffer_local_value (Qwindow_point_insertion_type, w->contents)
>
> is unbound and not nil.  I have to fix that.

> I tried to fix that on master now.  Please have a look.

Thanks, I confirm it's fixed.

>>> As I suggested earlier we can use the position of the buffer's point
>>> in every window regardless of whether it currently shows the buffer or
>>> we later switch to the buffer in it.  But this is not what we usually
>>> want when using multiple windows: We usually want them to show
>>> different portions of the same buffer.
>>
>> Yes, better to keep every window's own point.  Since usually I save
>> the selected window's point along with the window configuration,
>
> As number or as marker?

As marker.  But I guess due to marker invalidation after reverting
better to use numbers, or even better to get metadata depending
on major mode, e.g. in case of Dired - dired-filename.

>> in e.g.
>>
>> ((window-configuration-1 selected-window-point)
>>  (window-configuration-2 selected-window-point)
>>  ...)
>>
>> this could be extended to save a mapping of all windows points, e.g.
>>
>> ((window-configuration-1 ((window-a point-a) (window-b point-b) ...))
>>  (window-configuration-2 ...)
>>  ...)
>>
>>
>> But it's not a general solution.  A general solution would be to save
>> such metadata in the window configuration itself.
>
> But a configuration saves the point of each window, for the selected
> one it stores the point of that window's buffer.  Is it just because
> you want to be able to retrieve those values?  Or what am I missing?

It seems a configuration saves the point as marker, not as number, so it
invalidates on reverting.  It would be better if such stored metadata also
includes dired-filenames, or even a lambda that could move point to saved
filenames in Dired buffers.

((window-configuration-1 ((dired-window-1 . `(lambda () (dired-goto-file ,(dired-get-filename))))))
 (window-configuration-2 ...)
 ...)




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 12 Feb 2022 08:46:01 +0000
Resent-Message-ID: <handler.33871.B33871.16446555234766 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.16446555234766
          (code B ref 33871); Sat, 12 Feb 2022 08:46:01 +0000
Received: (at 33871) by debbugs.gnu.org; 12 Feb 2022 08:45:23 +0000
Received: from localhost ([127.0.0.1]:33396 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nIo1z-0001EX-9B
	for submit <at> debbugs.gnu.org; Sat, 12 Feb 2022 03:45:23 -0500
Received: from quimby.gnus.org ([95.216.78.240]:40094)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nIo1y-000184-EA
 for 33871 <at> debbugs.gnu.org; Sat, 12 Feb 2022 03:45:22 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=BbBYBQsAoNqpLY1HaHLMr3NptXU7iMxKbmTeJYjuD7A=; b=Ez+evV5VhZoTjhXsFGSQ20Qy2V
 Rn7E5TuVMYrAt1byfCKZI1vncLPx460cfckcQ7EHzBJ0uZHVKPEvL9dGyA0G3xr41ltO9znEwRV4j
 U1bFstsyUj9dWnNwPpPar2Yq4DVZ+4v8kPQ0G9zDWTtg/d9VKDryF4cEZnJ4O42S5RvQ=;
Received: from [84.212.220.105] (helo=giant)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nIo1p-0005W3-C3; Sat, 12 Feb 2022 09:45:16 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <87bm59mglk.fsf@HIDDEN>
X-Now-Playing: Zazou Bikaye's _Mr. Manager_: "(Little) Angel"
Date: Sat, 12 Feb 2022 09:45:11 +0100
In-Reply-To: <87bm59mglk.fsf@HIDDEN> (Juri Linkov's message of "Tue, 
 25 Dec 2018 23:39:03 +0200")
Message-ID: <87fsoo323s.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Juri Linkov <juri@HIDDEN> writes: > Try to eval in emacs
 -Q in *scratch*: > > (progn (dired "/tmp") (dired-next-line 1) >
 (split-window)
 (other-window 1) > (dired "/tmp") (dired-next-line 2) > (let ((w-c
 (current-window-configuration) [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Juri Linkov <juri@HIDDEN> writes:

> Try to eval in emacs -Q in *scratch*:
>
> (progn (dired "/tmp") (dired-next-line 1)
>        (split-window) (other-window 1)
>        (dired "/tmp") (dired-next-line 2)
>        (let ((w-c (current-window-configuration))
> 	     (p-m (point-marker)))
> 	 (view-emacs-todo) (delete-other-windows)
> 	 (with-current-buffer (get-buffer "tmp")
> 	   (revert-buffer))
> 	 (set-window-configuration w-c)
> 	 (goto-char p-m)))
>
> Result:
> - point in the selected Dired window moves to point-min
> - point in the non-selected Dired window moves to point-max

I tried this in Emacs 29, and point was point-min in both windows.  But
I'm not sure where point should end up after this code, really =F0=9F=98=80=
, so is
this working as expected now?

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 13 Feb 2022 18:46:01 +0000
Resent-Message-ID: <handler.33871.B33871.164477794426532 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.164477794426532
          (code B ref 33871); Sun, 13 Feb 2022 18:46:01 +0000
Received: (at 33871) by debbugs.gnu.org; 13 Feb 2022 18:45:44 +0000
Received: from localhost ([127.0.0.1]:38876 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nJJsV-0006ts-Nl
	for submit <at> debbugs.gnu.org; Sun, 13 Feb 2022 13:45:43 -0500
Received: from relay8-d.mail.gandi.net ([217.70.183.201]:53245)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1nJJsS-0006tG-Ne
 for 33871 <at> debbugs.gnu.org; Sun, 13 Feb 2022 13:45:41 -0500
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id 94C8D1BF203;
 Sun, 13 Feb 2022 18:45:33 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
Date: Sun, 13 Feb 2022 20:40:16 +0200
In-Reply-To: <87fsoo323s.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sat,
 12 Feb 2022 09:45:11 +0100")
Message-ID: <86h792x3wv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> (progn (dired "/tmp") (dired-next-line 1)
>>        (split-window) (other-window 1)
>>        (dired "/tmp") (dired-next-line 2)
>>        (let ((w-c (current-window-configuration))
>> 	     (p-m (point-marker)))
>> 	 (view-emacs-todo) (delete-other-windows)
>> 	 (with-current-buffer (get-buffer "tmp")
>> 	   (revert-buffer))
>> 	 (set-window-configuration w-c)
>> 	 (goto-char p-m)))
>>
>> Result:
>> - point in the selected Dired window moves to point-min
>> - point in the non-selected Dired window moves to point-max
>
> I tried this in Emacs 29, and point was point-min in both windows.  But
> I'm not sure where point should end up after this code, really 😀, so is
> this working as expected now?

It should end up where it was initially, i.e. on file names in Dired.
But this can achieved only by implementing context-aware markers,
such as used by the package saveplace.el, e.g.:

  ((window-configuration-1
     ((dired-window-1 . `(lambda () (dired-goto-file ,(dired-get-filename))))))
   (window-configuration-2 ...)
   ...)




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 14 Feb 2022 09:14:01 +0000
Resent-Message-ID: <handler.33871.B33871.164482999722360 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.164482999722360
          (code B ref 33871); Mon, 14 Feb 2022 09:14:01 +0000
Received: (at 33871) by debbugs.gnu.org; 14 Feb 2022 09:13:17 +0000
Received: from localhost ([127.0.0.1]:39688 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nJXQ5-0005oa-Cc
	for submit <at> debbugs.gnu.org; Mon, 14 Feb 2022 04:13:17 -0500
Received: from mout.gmx.net ([212.227.17.21]:46223)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1nJXQ0-0005oI-Ck
 for 33871 <at> debbugs.gnu.org; Mon, 14 Feb 2022 04:13:15 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1644829986;
 bh=LfNlHs8MGoOd9FKMGgC0Q6EQNn7JUnG89ugrjyIVKus=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To;
 b=gSERqs+WVn51ulzIjZGMyn7QWeKPsTyzWaQB4GG+mvfF2RZC/iAcS3rlYCYnAJmNa
 J0ltbQqlrFxcoowfVnLzsP7NH580XZ/GklhJvyjbUH6VlXc9gesua/OSnNfhMIh+zM
 z0aufp0KeLX1bMP1zyMzrhyRDvI8GCbEPz5WHD60=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.101] ([213.142.96.169]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mw9QC-1oBdZc0xr2-00s658; Mon, 14
 Feb 2022 10:13:04 +0100
Message-ID: <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
Date: Mon, 14 Feb 2022 10:13:00 +0100
MIME-Version: 1.0
Content-Language: en-US
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86h792x3wv.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:bohbAwEdH2wBM+baiUOB3UfIyk8guGYXrFIFuu0O8g5mrAE3ZTo
 WDeVc9+mc6OQ5tz22NJFPixSn8GSrsG9iHFdQs1MnkXWXHeNPxYlwXceqCEgeMA2KQoSnxV
 u+pCSELZtijLH9EZmIBvkMbqN7UMizFumejVyjkMpMvS/TP9Whul0CkLIUockcnWBVwQiSI
 ULdMgzaMCEXnvdlV/Ce7w==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:+aZ6r3Pau9c=:M7SHOvn4v3oLBkI2yzjtFG
 r/KZAOh+fzUhpZL8EfshAQKawrGi5TshZOvNtLOr4aiuunks7qD/tCLxFonRxf6QgdtcOPpTV
 OURA/eGJ2WBxYOyaC94YTVInZZHkHQ+JLf/VBr0uTWt1qYE3lf0Jnxx6Yiq/nXaNgihB527qF
 UBsYJ9MhSus4B4KflCnt/EA1dhRMAppVpnQSQxY7irCh6D3ZgdOMdPO6RhIFAPDA5nU8/FDtQ
 osBQUJM4gfeCloY7JiIrtgYxj043NtmrRKuNJz1PKIHjAw7uReZkAzP6oPuKHePCDj6DpGI3a
 g27Gjg4hzS3nQAtyApfRFQYZX5ZBLiDb5jQurXgZeLjQjl39A+WA2io0FISLvViKT9R8zIt6+
 WzRYHiR42NS2wg4Jx1X9CfPkH+gfaXv21pI5UBomHGh+Pa5wcB/43Maq8zOXnOqKtA7IIL2TR
 6VFEkVBYK69/TLQN8wLveI+onJTBzUEggai/lPg7mB9ciwEMttz74DcZZyFnZqb/rYZ3BNA56
 kjMYlRJxjxmNBAC81AwJdP/aeXWf4t9pazt66+71hbeajX0ygvPnbnDptsHFYsTxEp+HrwvkN
 Eekp/Yvit6vlanK5T6J1WhTyRZ6Bx42nOPHmN7yhRB8r47fH8IrzhahL1hx9xD00BNerLzR35
 CmL7Oh5cgzMYPJN9HMn/acupDPDOZ1wcdGRD6KahL/7uzcd4iFG4HI2L7WXayxj6863MAO+hC
 2Q6TGO2DxUnDSubt93IsRIG4Tzeh8nLEZ40ChOPH4jT9WQc0I7DbNPWZUtloBM9cAuCYh5zmT
 BF8xoyA1JLsQhxsxXV2viq7v/FBiitbTzQ+I8UoNh+dlBpfL/+K+t0zSDkWcFQeFyvC97cv6Z
 Mua1fgWrTms2931sRn+hURJmo+1kEvVRZgFxXQbZtFQY0qKm+P2z6yShxBLXcTeDmtr1qrR2N
 bSn94ZQ8bxAA0exFb7+Ks5RGhVexBgSbYjtMjuCMTBkc+7MUR9AG6AQ0yTRVp4G9PQq3udUVc
 VB5Cp8UqaHMd3ovGi9RIf23hVT3Czw31oqd8QyI9W0ltuyYdzww2iBQa6oiRvHxbUJRbmw5A6
 QR3Aw5MkvRapBM=
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > It should end up where it was initially, i.e. on file names in Dired.
 > But this can achieved only by implementing context-aware markers,
 > such as used by the package saveplace.el, e.g.:
 >
 >    ((window-configuration-1
 >       ((dired-window-1 . `(lambda () (dired-goto-file ,(dired-get-filename))))))
 >     (window-configuration-2 ...)
 >     ...)

Reverting a directory in a window could remember the name of the file
shown at the corresponding line and the offset of 'window-point' on that
line and also the entire contents of the old directory until revert
completes.  As soon as the new contents of the directory have been
established, dired would search the remembered name and position point
at the remembered offset accordingly.  If it does not find that name, it
would have to compare the contents of the old and current contents of
the directory and use some heuristics to position point appropriately.

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 14 Feb 2022 18:17:01 +0000
Resent-Message-ID: <handler.33871.B33871.16448625778193 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.16448625778193
          (code B ref 33871); Mon, 14 Feb 2022 18:17:01 +0000
Received: (at 33871) by debbugs.gnu.org; 14 Feb 2022 18:16:17 +0000
Received: from localhost ([127.0.0.1]:42514 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nJftY-000285-Vu
	for submit <at> debbugs.gnu.org; Mon, 14 Feb 2022 13:16:17 -0500
Received: from relay10.mail.gandi.net ([217.70.178.230]:55033)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1nJftW-00027q-GV
 for 33871 <at> debbugs.gnu.org; Mon, 14 Feb 2022 13:16:15 -0500
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id 302DF240008;
 Mon, 14 Feb 2022 18:16:06 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
Date: Mon, 14 Feb 2022 20:10:46 +0200
In-Reply-To: <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN> (martin rudalics's
 message of "Mon, 14 Feb 2022 10:13:00 +0100")
Message-ID: <861r05co9l.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> It should end up where it was initially, i.e. on file names in Dired.
>> But this can achieved only by implementing context-aware markers,
>> such as used by the package saveplace.el, e.g.:
>>
>>    ((window-configuration-1
>>       ((dired-window-1 . `(lambda () (dired-goto-file ,(dired-get-filename))))))
>>     (window-configuration-2 ...)
>>     ...)
>
> Reverting a directory in a window could remember the name of the file
> shown at the corresponding line and the offset of 'window-point' on that
> line and also the entire contents of the old directory until revert
> completes.  As soon as the new contents of the directory have been
> established, dired would search the remembered name and position point
> at the remembered offset accordingly.  If it does not find that name, it
> would have to compare the contents of the old and current contents of
> the directory and use some heuristics to position point appropriately.

You meant remembering the file name and window-point in a buffer-local variable?
Then it should be an alist with all windows of the same Dired buffer, e.g.

  (setq-local dired-positions
    '((#<window 1 on dired> dired-file-1 window-point-1)
      (#<window 2 on dired> dired-file-2 window-point-2)
      ...))




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 14 Feb 2022 18:37:01 +0000
Resent-Message-ID: <handler.33871.B33871.164486378510099 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.164486378510099
          (code B ref 33871); Mon, 14 Feb 2022 18:37:01 +0000
Received: (at 33871) by debbugs.gnu.org; 14 Feb 2022 18:36:25 +0000
Received: from localhost ([127.0.0.1]:42530 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nJgD3-0002co-6L
	for submit <at> debbugs.gnu.org; Mon, 14 Feb 2022 13:36:25 -0500
Received: from mout.gmx.net ([212.227.17.20]:46299)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1nJgD1-0002cb-GG
 for 33871 <at> debbugs.gnu.org; Mon, 14 Feb 2022 13:36:24 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1644863777;
 bh=WMt1GpFxTQ0wAl8cSerVUgnPJ3gJdOu2ewKB0yRXU4A=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To;
 b=AhWWi52YW1v7XB43v4UK0xpvH5euACPUrpHpUTi1hEoq6yOCabif+EZiXpxg/rHC3
 w8jGEHGtNT6+dmCcZIU37OCXB3BF3+XZiiQKPYWQo6JNh4sfas6mxEDuZ25MaENjMf
 bVCyEjGbc+DN0w6CO9s68cyWLf9B2INZaY5QkS+0=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.101] ([213.142.96.169]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MLiCu-1nbLcG2fmC-00Hgr9; Mon, 14
 Feb 2022 19:36:16 +0100
Message-ID: <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
Date: Mon, 14 Feb 2022 19:36:14 +0100
MIME-Version: 1.0
Content-Language: en-US
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <861r05co9l.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:8jbuNs+7EN+CtKiJsBdQYdBk3JZSZP5hncA6V+AGYe3kLEFDMZ9
 rz8LIxFoHVKw/WROc3rpDOcONAcrkVvam4l9i0W3OcTTJmPjsDMFn1EkRlZMDlUmPyRyHJN
 VAK3+mD96BOc7kYdurTUPVD/cKpF4g9WYkIqgy2B5xhLWnHazF3lS2jTssN7dFWrJ6daFVS
 VwyNqp+b82HGHuYtN1IEg==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:sRgiS4DMlCA=:++8TNQh5boDGn9Gf6dOCP7
 BkyB58UwCsVGL+1b+vQGI76lp/ZBgeTuH24a8PGdX1FLJiERdCu1BnR95vKxgtiYUPZN4Y5z/
 eMjxzc91CaWN1tv0VEuPr5SjD77ZniGHbvT8l7VrsXwLcHubkcm/fp4vQ1ra5b6Ddivmi6dDI
 5HMaLxGdPrjduHJ8RLnK8H+LBsEVkfSI7OpZIQBYoR2kks8b8K6jhTcsVfvZWD4WVZygLyZLS
 IfEaGsO/vfkP849CLuahk9Hctij2s3LJfJ1CbEGCKpMCHatlSBBAFwNOc9SB/lkI1/+zhEjTz
 QThX7SQJ9wal90Wa2i/Dv/RdwmTft3phv3PY2Fv4fbVA0tmHl10Y1HuZn3F66UIRfCgMr5hId
 PvUraqi18ORiTnVCsxBgIQ5fnB9m07wm3cNOY1YIFCo+5dYCcLkrc1ZdktXuJQ67GzD5TbiY7
 7FbPglR1KAqQvLCIByuRH66bi96qfEbLQOqHqNZAeKsyStTyebaMLep15Sc7FCf6p3Uc34OXL
 02rVzJftK3fX1gtlwYQqD4gdcdWsK6+e51uG/zVgKjyyJzEnspFrXm1YMGBKaOoi0kDvzM7fq
 Zffky9aSmAlKHsslL/uRGSq+1gOfcloVBkMCWCnTj7p9AhbJdVqIo8HeFT02Pi/XYhLp00LJO
 2QS2227uU5zVilsqwQurYMiKDAJtZ7jPAYMG+n1fF8t51Yw87Vy15rYJQgNvV0oyzQSKRwhUL
 X+mELEJrcnVyGQ0AS6Rwu6R8ujPOgtVrlOhgLCxolyMQLKUBq+c5CxrMiZE3SB5g/8angTGc6
 UIoBj2gUpwnewsUgjaYRyYaNS0ji5+ClQmXnrg53OOiyUXa+6fInQU0Xq3tXAzJd9i0dIcMkM
 a5FY5k5ZTaIKYPoP/SsYDPsxjytV8d1s6jz3VGi7aOkRKysEczJIH0ONccsAaQeKknKiGzUUA
 l3xZKqhoIlJ0gpDZN6OLa3p7Gin8A2IHVEds2YtPHNnPSoSqvEMXkVqzbCvqrrF+BU78KYNL0
 YKk0+TRVgVinUZjiFXiUXMmxlJfglG1igtINtsinWX0GkdBJMDdXgukh4ka0WVfLiTFu7+hCU
 YrB8InknKK3mVE=
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > You meant remembering the file name and window-point in a buffer-local variable?
 > Then it should be an alist with all windows of the same Dired buffer, e.g.
 >
 >    (setq-local dired-positions
 >      '((#<window 1 on dired> dired-file-1 window-point-1)
 >        (#<window 2 on dired> dired-file-2 window-point-2)
 >        ...))

Or a window parameter of each dired window.  Note that the third item
would be just the offset of 'window-point' from its line beginning
position.  'window-point' itself is completely useless here.

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 15 Feb 2022 19:31:02 +0000
Resent-Message-ID: <handler.33871.B33871.164495345817216 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.164495345817216
          (code B ref 33871); Tue, 15 Feb 2022 19:31:02 +0000
Received: (at 33871) by debbugs.gnu.org; 15 Feb 2022 19:30:58 +0000
Received: from localhost ([127.0.0.1]:46493 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nK3XO-0004Tc-Dv
	for submit <at> debbugs.gnu.org; Tue, 15 Feb 2022 14:30:58 -0500
Received: from relay10.mail.gandi.net ([217.70.178.230]:47101)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1nK3XL-0004T9-MD
 for 33871 <at> debbugs.gnu.org; Tue, 15 Feb 2022 14:30:56 -0500
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id ED3E324000A;
 Tue, 15 Feb 2022 19:30:47 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
Date: Tue, 15 Feb 2022 21:30:29 +0200
In-Reply-To: <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN> (martin rudalics's
 message of "Mon, 14 Feb 2022 19:36:14 +0100")
Message-ID: <86zgmsne32.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> You meant remembering the file name and window-point in a buffer-local variable?
>> Then it should be an alist with all windows of the same Dired buffer, e.g.
>>
>>    (setq-local dired-positions
>>      '((#<window 1 on dired> dired-file-1 window-point-1)
>>        (#<window 2 on dired> dired-file-2 window-point-2)
>>        ...))
>
> Or a window parameter of each dired window.

In case of a window parameter wouldn't the situation be inverted,
so it will use an alist too, but where keys are all dired buffers
displayed in that window from the prev-buffers list:

  (set-window-parameter window 'dired-positions
    '((#<buffer *dired-1*> dired-file-1 window-point-1)
      (#<buffer *dired-2*> dired-file-2 window-point-2)
      ...))

> Note that the third item
> would be just the offset of 'window-point' from its line beginning
> position.  'window-point' itself is completely useless here.

Maybe 'window-start' would be more useful?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 16 Feb 2022 08:51:01 +0000
Resent-Message-ID: <handler.33871.B33871.164500144223164 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.164500144223164
          (code B ref 33871); Wed, 16 Feb 2022 08:51:01 +0000
Received: (at 33871) by debbugs.gnu.org; 16 Feb 2022 08:50:42 +0000
Received: from localhost ([127.0.0.1]:47348 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nKG1J-00061Y-Rs
	for submit <at> debbugs.gnu.org; Wed, 16 Feb 2022 03:50:42 -0500
Received: from mout.gmx.net ([212.227.17.20]:48563)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1nKG1H-00061H-Mn
 for 33871 <at> debbugs.gnu.org; Wed, 16 Feb 2022 03:50:40 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1645001433;
 bh=0Jb6GfnNeNM+M7RchI2f8OZtFPUwHOsuiaUqKiUWUmY=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To;
 b=YQOuATuS63mhecFXOdG76hnjaGutFBJCcCAexGkbofOJN4Ijo6ev9qShe0PErhqMZ
 Ze3ensu6QH+0GJmPOUTE9kwbR3iwScsSp/zeI0Owf9bKhTvCNxSseJnkF12zPEbYqK
 R5QArrw+2KbgbWSTZv2ZRrz7TrfvUv1WJLbrE5bI=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.101] ([213.142.97.210]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MvsEx-1oAiFS0DdX-00swvJ; Wed, 16
 Feb 2022 09:50:33 +0100
Message-ID: <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
Date: Wed, 16 Feb 2022 09:50:31 +0100
MIME-Version: 1.0
Content-Language: en-US
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86zgmsne32.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:4afEsotowDd2wDdVAZ1niOjNQrbWDTN9nQDPylElOAnwZnCRQ+H
 j9JrE4HGXvTMTxjXGNzM9pOcBAhacF8qtcIyHVcUEnfjzSn53Lj1jaMVcCyBND4hXCVwLCR
 lEE1gtd8cxjsKJii17eVcNQYSrb+mX8lVY8l9/dv7Ta1Hhf0nO1fWlEyYR/9ssDLtcmjaYC
 DqF4LWj0D//5GphE8m0Tw==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:dZwnaUvPi2c=:eti3l6hLz4o7q21h+VTTn3
 ZclmSOY0iwoQ2p65RWOjaTIuLMzcSh5pAixS+5jnMbMZEkFHzykqEu3IJGM8XL7HwKBkv5qmp
 Co0+PbapNSbQOLG289LIxG7EV5tEKnMluHvmuYL+350cMB/5PZU/QxSBitIfdLAEfbBEXOMSU
 9zG0Cuk1ozSMq+yFPymUUqCo8QTLtE2LGJDOmBsdE2S5ax9ugfxUdylCbn0BmTYOe5Wua21id
 e2/K3LMTyPbHeYrlKcOE7ktwe8/dcHkjk6SPq5FkYWSynMYE2bcI0yOcCaCddvU24+Yq2jVB5
 23ORHhkary6FaL3PdBynsEf0uO0NO1PH1fIly0Mjal1mJBxo7Hd2JSZWiuVUcU4DvH9wvL+FQ
 0DvhUFC5EkjoEjBnXVIsZNAvviK3FlsB/ycBZHce5X7dnvmlILNld9QVYv1MqLyNto50tVNcL
 kuyQ5YCOeq+W5JRVSuUllGwxyXbRTbRnmecrEkdoqXhzWMv4Mz4ghPP0o5Z3b2x5/NmvjWP1+
 GEFhQ/bWIt/6j9zbfCnhHoB8EqYrDn80giYyE34nMhHX8bfaPtdaU+pg7URyYAnE/S1IqFxA0
 q/SCfhtA2zTaXWZA0S9+lIguk7/ZNRRlzx76PhNuGGjtOqSKpRvH7k1SiYMGRa/mZxv14LCjC
 +cKVhCHjexXaVKhq4HHuY/aF8Xp90D3Cxbgrk3KSgEIKNDV60/W79Dw0o2AES1QDJbtWNsdBE
 emhSKIn+eeIjnaQrzVw8CiFLREJZ+BB+pk6NnW57OD6s0JpGNW9CJdZrej/+tI2/+q7TtNENX
 xihCgqJ/Ju/1UoJ9VyGQeVLdBDmlxza0NRFDzLmPXsZj51YNLW1Gkg7PmRSEeuQN6Zc1AsHHy
 6uR2Uo6ZtHP35TjjILuR8p0izHHv0vy/m4o0kSUtiYaga0jnszeXgVz9vmYukg3c4C+xRfHwG
 34P06lF+DDxeOu9wignV4vcPmpg81kZ8LNytRpE7fdgLFrgCHfIuI2vqzOvn2j4EkfEFG+KvY
 K2Ncp62dz5zsx4RBDhK0Nt1GkzUxaPM6PZCU6lJxl71CF9ZmJGJGe2YD8Z8cPZwBm2JHzNS8/
 c557zq4bcGtLRg=
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > In case of a window parameter wouldn't the situation be inverted,
 > so it will use an alist too, but where keys are all dired buffers
 > displayed in that window from the prev-buffers list:
 >
 >    (set-window-parameter window 'dired-positions
 >      '((#<buffer *dired-1*> dired-file-1 window-point-1)
 >        (#<buffer *dired-2*> dired-file-2 window-point-2)
 >        ...))

Something like that.  But I still fail to see what these lines are
supposed to accomplish in your scenario:

	 (set-window-configuration w-c)
	 (goto-char p-m)))

What is it 'dired-restore-positions' does not handle here?  IIUC your
lines mangle everything it has done.

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 16 Feb 2022 18:45:02 +0000
Resent-Message-ID: <handler.33871.B33871.164503709123278 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.164503709123278
          (code B ref 33871); Wed, 16 Feb 2022 18:45:02 +0000
Received: (at 33871) by debbugs.gnu.org; 16 Feb 2022 18:44:51 +0000
Received: from localhost ([127.0.0.1]:49434 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nKPII-00063O-Q6
	for submit <at> debbugs.gnu.org; Wed, 16 Feb 2022 13:44:50 -0500
Received: from relay8-d.mail.gandi.net ([217.70.183.201]:52195)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1nKPIH-00062k-2P
 for 33871 <at> debbugs.gnu.org; Wed, 16 Feb 2022 13:44:49 -0500
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id 80F611BF206;
 Wed, 16 Feb 2022 18:44:41 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
Date: Wed, 16 Feb 2022 20:34:35 +0200
In-Reply-To: <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN> (martin rudalics's
 message of "Wed, 16 Feb 2022 09:50:31 +0100")
Message-ID: <86sfsi29yc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>>    (set-window-parameter window 'dired-positions
>>      '((#<buffer *dired-1*> dired-file-1 window-point-1)
>>        (#<buffer *dired-2*> dired-file-2 window-point-2)
>>        ...))
>
> Something like that.  But I still fail to see what these lines are
> supposed to accomplish in your scenario:
>
> 	 (set-window-configuration w-c)
> 	 (goto-char p-m)))
>
> What is it 'dired-restore-positions' does not handle here?  IIUC your
> lines mangle everything it has done.

Instead of (goto-char p-m), after (set-window-configuration w-c)
something like this should be performed:

  (dired-goto-file (car (cdr (assoc (current-buffer)
                                    (window-parameter nil 'dired-positions)))))




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 17 Feb 2022 10:07:02 +0000
Resent-Message-ID: <handler.33871.B33871.164509236710314 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.164509236710314
          (code B ref 33871); Thu, 17 Feb 2022 10:07:02 +0000
Received: (at 33871) by debbugs.gnu.org; 17 Feb 2022 10:06:07 +0000
Received: from localhost ([127.0.0.1]:50210 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nKdfr-0002gI-AK
	for submit <at> debbugs.gnu.org; Thu, 17 Feb 2022 05:06:07 -0500
Received: from mout.gmx.net ([212.227.17.22]:53643)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1nKdfp-0002fn-3X
 for 33871 <at> debbugs.gnu.org; Thu, 17 Feb 2022 05:06:06 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1645092358;
 bh=2oJBv9JX9cprdscp80hcmFJoE7vWWkjFfFFKW05pANU=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To;
 b=AbfeQqZMIviLCY28Ir331IhaDFbVDrH3Daht1lOFHcHAahv4KUvYSm5jA+hzWuhd8
 5El16LuewIbmE82GUoGYM8FliSbu94CEcLr9DLcXPG4wIq4vLYkQ63u/nh7vLGihQt
 QZNWbn0TuHaag6dK07ikjKon1/7e/aCknHoXRMvw=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.101] ([213.142.96.55]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MXXyJ-1nlw0P0oNb-00YvFY; Thu, 17
 Feb 2022 11:05:58 +0100
Message-ID: <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
Date: Thu, 17 Feb 2022 11:05:56 +0100
MIME-Version: 1.0
Content-Language: en-US
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86sfsi29yc.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:hRgxKdYGonuWLOeiHzzPBluYobKNZz19I4ZsnqcnzR6CjiK92wY
 FkxPuh6vDe9ThdX1lVwyEGZHLtHGcsDVhLdJjfT4g6EhfWv3S+C0H7D3kbqYYA6gHoVwlzB
 0tjEyH5r+w9LPaMPQ12fcA9w7hnm1WHJ3sHMLxCqTRlyL0poT2HpIHKOea3H90cl6AoCA66
 lggnvMFPJmq5YiFupe8MA==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:kB719ISav2o=:HYD9LKnK/lPh0RivuKa71l
 sGyQ6BHsGh8HwRQz9NILmEJ5zi1JKQPFX44409XibuIgcpdO5UVcopcwp3O7QDdGtOkXx3Ssd
 34j6MS67ODqptdj244LWlPGBYLSh8kBas+pUEIeVdzO3PLB9bOg36mDMzuoKdbtGjuj7SXq86
 x66D101sJeZFCqacYKdOc8+z1iQq6VpMtdAlea9RHqyNZy0PmXd4kw1ytfuInScHtQXNCmKaY
 EGArt/KY0rQM/ql85DrTarvWt0vlw98Cy97bFWisCv+RCBaDnXb38KcVvERZZ08mGuo+ig09H
 sm5nXJgV7648I5sq6W6UnqXv4eXrYtfcH6NmLhkE98hQdmX3QLh9RuyJ5Nkf2r+62tOYp0INO
 +dJ/6vNr3CmzyZfA9SfJh7DuOOdY1oASRwdTteM0EkzsXWKEo194JxlM7oMI3BH/WxPLzRAL2
 TvaF2IkabnHOtb7Hph8HKCXPu7z6Xb3u/n1nHpGUp2oH4h7SQiS8HnQNtKs9vH7kICWts2IQx
 naKrqEGFQ/W7iy29afiBkhXGw4OFtMIAwYLYgL5ld8zG6s8KlwLueld7bKxp2nblcxmWCFISv
 qtkEh8IOhmc3PCHiSb64TsQKIlcqxTFlF9mm6YMpZ1krgYr8447Erw+LKSnz3YpGti1jZ3LRc
 pTdacPf7/ewUkH/Ov2potG1Qd1jhq16Emz59iQ50qJSe3gCAhcvCjCyf3sy/8cIG4YU2a3Ppf
 UDmhcwRKRWTDV/FNDA7AUM32XRoTmNIJjHVaCZB0cGmbC+fEbFY/+IgF6ZlenodPPbEEYd4Ci
 jkHbevm/r8ZArAmjCWAIYwJYgk/fxDg7gsfjiqTKcFcAzEgltqgW4HIGrBuf5tA8zbCCkI82R
 5jKhiGxio6ws7Dh+aUK9l8dsC0KrWk9BXXHlS6Dl1I32c+MBH3we6RvhqIhtWlKKJqU1iEAsr
 Qiz/eHv4YjeZ2cS4y1INqL4/WbVdpxdA5BadsaDR1+4N3hHVxkA5zw7inP9nkWht6bWf6Euz9
 R9AG14nG298dSUfJVyNPXfhhfIbiqxuJ3glgP6vrzMYnMk5x21xCTB/8EFF/A2tYM+HJ/tgeE
 1A2Vxatqlwji3U=
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > Instead of (goto-char p-m), after (set-window-configuration w-c)
 > something like this should be performed:
 >
 >    (dired-goto-file (car (cdr (assoc (current-buffer)
 >                                      (window-parameter nil 'dired-positions)))))

Once more: Your scenario is

(progn (dired "/tmp") (dired-next-line 1)
        (split-window) (other-window 1)
        (dired "/tmp") (dired-next-line 2)
        (let ((w-c (current-window-configuration))
	     (p-m (point-marker)))
	 (view-emacs-todo) (delete-other-windows)
	 (with-current-buffer (get-buffer "tmp")
	   (revert-buffer))
	 (set-window-configuration w-c)
	 (goto-char p-m)))

But this cannot work with dired buffers because they are reverted in a
special way that does not care about 'window-point' and the like.  This
means that the value of 'point-marker' you saved in p-m has become just
meaningless after the 'revert-buffer' call.

Basically, this is a hard problem we'll probably never be able to solve
satisfactorily.

We could handle 'window-point' separately when saving and restoring
window configurations and the window's buffer is a dired buffer.  For
example, 'dired-revert' could call a function 'window-revert-timestamp'
to store the current time of the revert operation for this window and
'current-window-configuration' (and 'window-state-get') would store
their current time stamp in the configuration (or state).  Then
'set-window-configuration' (and 'window-state-put') could check whether
a window's revert time stamp is larger than the time stamp stored in the
configuration and not set point for that window when the revert time
stamp is later.  Is it worth the hassle?

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 17 Feb 2022 17:49:02 +0000
Resent-Message-ID: <handler.33871.B33871.164512010728733 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.164512010728733
          (code B ref 33871); Thu, 17 Feb 2022 17:49:02 +0000
Received: (at 33871) by debbugs.gnu.org; 17 Feb 2022 17:48:27 +0000
Received: from localhost ([127.0.0.1]:52636 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nKktH-0007TM-9V
	for submit <at> debbugs.gnu.org; Thu, 17 Feb 2022 12:48:27 -0500
Received: from relay4-d.mail.gandi.net ([217.70.183.196]:60949)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1nKktD-0007T4-DP
 for 33871 <at> debbugs.gnu.org; Thu, 17 Feb 2022 12:48:25 -0500
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id AD23AE0006;
 Thu, 17 Feb 2022 17:48:15 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
Date: Thu, 17 Feb 2022 19:28:18 +0200
In-Reply-To: <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN> (martin rudalics's
 message of "Thu, 17 Feb 2022 11:05:56 +0100")
Message-ID: <86fsohmqn9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> Instead of (goto-char p-m), after (set-window-configuration w-c)
>> something like this should be performed:
>>
>>    (dired-goto-file (car (cdr (assoc (current-buffer)
>>                                      (window-parameter nil 'dired-positions)))))
>
> Once more: Your scenario is
>
> (progn (dired "/tmp") (dired-next-line 1)
>        (split-window) (other-window 1)
>        (dired "/tmp") (dired-next-line 2)
>        (let ((w-c (current-window-configuration))
> 	     (p-m (point-marker)))
> 	 (view-emacs-todo) (delete-other-windows)
> 	 (with-current-buffer (get-buffer "tmp")
> 	   (revert-buffer))
> 	 (set-window-configuration w-c)
> 	 (goto-char p-m)))
>
> But this cannot work with dired buffers because they are reverted in a
> special way that does not care about 'window-point' and the like.  This
> means that the value of 'point-marker' you saved in p-m has become just
> meaningless after the 'revert-buffer' call.
>
> Basically, this is a hard problem we'll probably never be able to solve
> satisfactorily.

But this works fine:

  (progn (dired "/tmp") (dired-next-line 1)
         (split-window) (other-window 1)
         (dired "/tmp") (dired-next-line 2)
         (walk-windows
          (lambda (w)
            (set-window-parameter
             w 'dired-positions
             (list (with-selected-window w
                     (dired-get-filename nil t))
                   (window-start w)
                   (window-point w)))))
         (let ((w-c (current-window-configuration)))
           (view-emacs-todo) (delete-other-windows)
           (with-current-buffer (get-buffer "tmp")
             (revert-buffer))
           (set-window-configuration w-c)
           (walk-windows
            (lambda (w)
              (let ((pos (window-parameter w 'dired-positions)))
                (when pos
                  (with-selected-window w
                    (dired-goto-file (nth 0 pos)))
                  (set-window-start w (nth 1 pos))
                  (set-window-point w (nth 2 pos))))))))

> We could handle 'window-point' separately when saving and restoring
> window configurations and the window's buffer is a dired buffer.  For
> example, 'dired-revert' could call a function 'window-revert-timestamp'
> to store the current time of the revert operation for this window and
> 'current-window-configuration' (and 'window-state-get') would store
> their current time stamp in the configuration (or state).  Then
> 'set-window-configuration' (and 'window-state-put') could check whether
> a window's revert time stamp is larger than the time stamp stored in the
> configuration and not set point for that window when the revert time
> stamp is later.  Is it worth the hassle?

I think it's not worth the hassle.  The above solution is simpler.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 19 Feb 2022 09:38:01 +0000
Resent-Message-ID: <handler.33871.B33871.16452634723385 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.16452634723385
          (code B ref 33871); Sat, 19 Feb 2022 09:38:01 +0000
Received: (at 33871) by debbugs.gnu.org; 19 Feb 2022 09:37:52 +0000
Received: from localhost ([127.0.0.1]:56894 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nLMBc-0000sX-2x
	for submit <at> debbugs.gnu.org; Sat, 19 Feb 2022 04:37:52 -0500
Received: from mout.gmx.net ([212.227.17.20]:58717)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1nLMBZ-0000sK-RA
 for 33871 <at> debbugs.gnu.org; Sat, 19 Feb 2022 04:37:50 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1645263462;
 bh=5Za/+PTQI4iy8i52axwxAStBj8a/dUhSFGq9fE1GJsw=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To;
 b=k7fAJGZTQzC8fHmo0hSp8b+lagL9JksEw6Ggs7A7xgGrVdLyxsWrrG+lk9b17QtBY
 1IdFtPGvhm9/YMXRXUtQkYQaBoW06fL2CTDWR9PYKrdawzU4vHLuW8HRLBCGOMlRKW
 t+V5+HxWKgRQ+XdZTE5tguWSl2cjcBnsRWVQax8Y=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.102] ([46.125.249.118]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MMGRK-1nefz635gU-00JLBd; Sat, 19
 Feb 2022 10:37:42 +0100
Message-ID: <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
Date: Sat, 19 Feb 2022 10:37:40 +0100
MIME-Version: 1.0
Content-Language: en-US
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86fsohmqn9.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:7071T63a70guAY9s+GbnoXKaG4e9bXAdBPSnklxfa2ajDkV1r92
 upZYNFE1X2xdwsiw1N1/K1fhuLRiM3b1bg+yFF7k9/3qTgylmN5u9knqfncnWeztlvE9qVA
 uN3oHmS7veRZzdBR4z7v6SxJSHEQqxEyJKR5MzIWBHEsplnj6m5tC188nitiycZ/fgPvH+c
 88BhCpBIB8MRSdMRvuBSQ==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:d0rGO8Qa5nw=:CpX0TfH8Y6Lk1hgZBiSe3Q
 N7S7VwIb8hImPfYfJZ5RS218bkBkAnKcDi8nQcg5CCSvBU80mEQ/eLvnEbd4ZUp1Nuoa+edg8
 u/ZV6i0bt8NVzTvYQ/Rv/O27zD26MXlyi13NcyXHePpLP4aLXbwcIlMec1znKkP9k020soAhi
 NP2PsF5qKQHfjWpcIxukXdm9uHQExBcdAVgtTjuojyI19AvphMUDXrGVwj5YRgjTTFFbPKONC
 W+RPBsaIfZUBN5veMzws3fc7vzA4oeHEqjQR8M4OTaSmhJNSbaEJ1SMcFx90XXoD8/UH+kvjO
 N0enGucejy0QDTB7UAYICb01Tgsq88AD0jKeAgFCyZ/fp8FOZOwKCXRiVVEtqDkGfuCBRbvF3
 xOrl6JSD3ZeoRbn/fgPTu29kKnO0dUYVSJcBWPc5uckTpMWyWbLbf08GL0sj3yNlg4UYQd/yC
 2IFzUcFaypYgzIX2fV/aJeWJSVimyIKY5xLWwEBFavgfIqZu3uOPQ0I6B+9G5fJQIyvSU+Idd
 QECLEAhkBRKTHxjyu4NXYLFpGJ3GRdQ7+VcbOrY7eE3xJ2Ya87/46bABvyXTtvJyE4Qrb4o0u
 KUcCwpqx6/9xXsgXRNK4cF7DGGPyo9PYZZ0biLahuyvgLFddmvLe4o1C7v4INx1vJuaO3JZsW
 YwVFyhcEVWerynVU+rBDi4JvpRCqVHfZdHpQScWs6UWKm20J26LcGJK64Nz/cEy3++GMuZibC
 UAtOqDMbCpp4wacpmALrC9E+MjOAjtKBrn3O2qvN9n8NOH2336/uGnT4GL3nCEoU06qDoDaNZ
 I3Rt+NdRcGyQt1oM4w2RFh8kiNatAaDtoDD8wh1RkzTjToXOKAJAtrzjmjiYnB5Z0/JdjZcjN
 x5NnY1wWAM6H3X6PLlnd6P1GXEm9AvDS/uWyu1LSr/Qc/leeWFb0R+2DmoVX8SuXaBBvVjVwP
 WodwGtIFB7DrDv53INVEs2vQFWT1mPOLN7qa0ETZHNgx97cXs+P20ZtBi05RSi53ZTG9p5rFB
 s3fhY6TrzHp2c+k/9HV5EIqKFazDOCrSdC3w/9h2bPXDrrN8MlQ0WOyPp2iohKUbvEcc+YiaU
 49x43HvYML61iQ=
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 >                  (when pos
 >                    (with-selected-window w
 >                      (dired-goto-file (nth 0 pos)))
 >                    (set-window-start w (nth 1 pos))
 >                    (set-window-point w (nth 2 pos))))))))

Shouldn't you call 'dired-goto-file' last here?  Otherwise, wouldn't
'set-window-point' override it?

And how would you handle the general case where a directory gets
reverted in between saving and restoring a window configuration?  If you
don't want to use timestamps, saving and restoring window configurations
would have to provide some special hooks and data structures for storing
such extra information.

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 19 Feb 2022 17:09:01 +0000
Resent-Message-ID: <handler.33871.B33871.164529053210655 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.164529053210655
          (code B ref 33871); Sat, 19 Feb 2022 17:09:01 +0000
Received: (at 33871) by debbugs.gnu.org; 19 Feb 2022 17:08:52 +0000
Received: from localhost ([127.0.0.1]:58653 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nLTE4-0002lm-Jl
	for submit <at> debbugs.gnu.org; Sat, 19 Feb 2022 12:08:52 -0500
Received: from relay12.mail.gandi.net ([217.70.178.232]:46653)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1nLTE3-0002lZ-1Z
 for 33871 <at> debbugs.gnu.org; Sat, 19 Feb 2022 12:08:51 -0500
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id B8DC5200006;
 Sat, 19 Feb 2022 17:08:42 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
Date: Sat, 19 Feb 2022 19:08:12 +0200
In-Reply-To: <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN> (martin rudalics's
 message of "Sat, 19 Feb 2022 10:37:40 +0100")
Message-ID: <86fsoezsw3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>>                  (when pos
>>                    (with-selected-window w
>>                      (dired-goto-file (nth 0 pos)))
>>                    (set-window-start w (nth 1 pos))
>>                    (set-window-point w (nth 2 pos))))))))
>
> Shouldn't you call 'dired-goto-file' last here?  Otherwise, wouldn't
> 'set-window-point' override it?

Then probably 'set-window-point' is not needed.

> And how would you handle the general case where a directory gets
> reverted in between saving and restoring a window configuration?  If you
> don't want to use timestamps, saving and restoring window configurations
> would have to provide some special hooks and data structures for storing
> such extra information.

I don't understand the problem.  'dired-goto-file' can go to the file
even after a directory gets reverted.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 19 Feb 2022 17:23:02 +0000
Resent-Message-ID: <handler.33871.B33871.164529133311927 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.164529133311927
          (code B ref 33871); Sat, 19 Feb 2022 17:23:02 +0000
Received: (at 33871) by debbugs.gnu.org; 19 Feb 2022 17:22:13 +0000
Received: from localhost ([127.0.0.1]:58663 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nLTQz-00036J-3H
	for submit <at> debbugs.gnu.org; Sat, 19 Feb 2022 12:22:13 -0500
Received: from mout.gmx.net ([212.227.17.21]:54813)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1nLTQw-000364-Gb
 for 33871 <at> debbugs.gnu.org; Sat, 19 Feb 2022 12:22:11 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1645291324;
 bh=G4oe+eQdGVeU7RwqZk0lZOe+15rhqBiAjXrOLygdYZg=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To;
 b=AIqZIT81ckdy5oSlnO9Z5m0R190esLDhKXIFqDgUSSLGYJ987PUNm95C9eg29ShRq
 Ef6KTUdEbfNj0B4fEG3bFKZdpFZQwUalNc31fW7mIU1ZspXrz9nFrtWy+5IPzgbUhO
 Sb3CI8ukaSCejxpLoXjnfMizEAYml6Egq7l+/iB4=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.102] ([46.125.249.118]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mg6Zq-1nuHLO04AY-00hcK6; Sat, 19
 Feb 2022 18:22:04 +0100
Message-ID: <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
Date: Sat, 19 Feb 2022 18:22:02 +0100
MIME-Version: 1.0
Content-Language: en-US
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86fsoezsw3.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:A/xiwWib/Z545nWD5kwXGE50clhfnbV2pyLed3y1ejnHCFTb64U
 fHiHeXuB2iGJXqneFdVJtuXDJgbBnJmf/XZqYA9XivwF7/ydPVZt4rcZFGRvcIRez7ULpdT
 4JtROrloyeJGi6tBSj1QQf8keX1CGH7twA3cFHgcNQk5M6PEdo/1pvlkSTcZgEOYdnIYMBQ
 bzC0EzHrZ9LImo2AMM+Xw==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:4sZ5txCS9rs=:JkOM86CtoJv/b83a1Vch6r
 fHWs0ZMrKJqTYDa+Veg57NMFDrGP53oJDqrL833KXWOvisTYMZSrG7XyeiFwEB8Shh7BAc5ys
 tKU4BxK/wb7Mb67qvLOjXJZe8Gk5GIgFdfTljDwTr87vZF+M/FhRrlR+GwBJ3jzZOKVKvIYb4
 e8qWZxo2nnHhnLNv6tdFBfPuM5m8KBDDv2qEfvb/lpA+kMYhPxt3Vv/F8KSRO+87dXiUu2nLp
 6R4uW3R+mOY2V7Htqovdi0UzVCgnRgc1HB5YHjUE25BFMRzXQRgh3dy1C92SNwZI5GRfl8lwi
 GHNdkbz9Zs7aJ/fCvdrCQlfVCeN3fh0rtuoEDVMDtGloK/4rAAdefhB9i6C1BwN3R4giidLcb
 DARMJE03l/q37WQ31nYMW9zF2go8q2VB3ymHJMThr8uEwVzCchx4cKyiKwQCNA7ZfCO6fpV6p
 j5V1/NfdO8g8Q5zNQ04ZATXnExMI7lZR60Y3N+9lxjcI9X1gTUTi6xVUNeUxr4Ht/G+fcaLux
 X77V55K79UyJDB5sdu/yqqgK80mCZxZsC/CUp5matjgXdf7Dj7hwXsTHX2Pw0aGrjraqjPe6n
 QW4Syhpja7jfZnU/weEzKZHJ08CERqRUMn5vHMCnk08NN4J0HWE6Hyay25zhCqgk2YF7dWxeh
 CIAdVDT5cmSrNdlJO++OG4vSD84FFvCJCpSP/Mf24qSxTg+QWeNzH385zFgW72P/akFnWJmJs
 R/NQHtk4WmNjZkX4clK2G4Fb2147aXN/9hwtgSYgziySjeQO9UpPsL5g39KDmCd6APdBLAaVM
 NA7bKG2o7iRzlE4vFbFS3kVStAyydsrKdA5OGSdXf5XK5dIlBil1zwtp6dUhnJaO4Pi74b5rd
 7mMd9DMxTH2Hhuvlc3IzryDUQ1hK/YIPJcE+xfHIY9t1dQXhc1MawmlScHCcQvcwfg8Z1rdlK
 g+xGWE6lRI1bwcjoGv6MgwUBDqtL0OKyj/h/VT3uxJZSwSvq42/MvjeKgBR93/cAbBPjXAEa0
 1V8BbylHWNCcBDw8kMCh8Fg1kFQSr7pIu4edxJpmsIfzPGY+1e8+O6BwKnWUZduzT3Oi1xX6J
 pmb3Vo3RNu0tNM=
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > I don't understand the problem.  'dired-goto-file' can go to the file
 > even after a directory gets reverted.

How would 'save-window-excursion' handle the case of a dired buffer that
gets reverted while its FORMS are run?

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 20 Feb 2022 18:59:01 +0000
Resent-Message-ID: <handler.33871.B33871.164538354118471 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.164538354118471
          (code B ref 33871); Sun, 20 Feb 2022 18:59:01 +0000
Received: (at 33871) by debbugs.gnu.org; 20 Feb 2022 18:59:01 +0000
Received: from localhost ([127.0.0.1]:33720 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nLrQD-0004nn-2t
	for submit <at> debbugs.gnu.org; Sun, 20 Feb 2022 13:59:01 -0500
Received: from relay4-d.mail.gandi.net ([217.70.183.196]:42545)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1nLrQ6-0004nN-Hg
 for 33871 <at> debbugs.gnu.org; Sun, 20 Feb 2022 13:58:59 -0500
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id 9786CE0009;
 Sun, 20 Feb 2022 18:58:46 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
Date: Sun, 20 Feb 2022 20:40:04 +0200
In-Reply-To: <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN> (martin rudalics's
 message of "Sat, 19 Feb 2022 18:22:02 +0100")
Message-ID: <86sfsewvxr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> I don't understand the problem.  'dired-goto-file' can go to the file
>> even after a directory gets reverted.
>
> How would 'save-window-excursion' handle the case of a dired buffer that
> gets reverted while its FORMS are run?

'dired-goto-file' will restore dired-positions after 'save-window-excursion'.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 21 Feb 2022 09:08:01 +0000
Resent-Message-ID: <handler.33871.B33871.16454344473700 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.16454344473700
          (code B ref 33871); Mon, 21 Feb 2022 09:08:01 +0000
Received: (at 33871) by debbugs.gnu.org; 21 Feb 2022 09:07:27 +0000
Received: from localhost ([127.0.0.1]:35011 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nM4fH-0000xc-6B
	for submit <at> debbugs.gnu.org; Mon, 21 Feb 2022 04:07:27 -0500
Received: from mout.gmx.net ([212.227.17.20]:51255)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1nM4fF-0000xM-Pb
 for 33871 <at> debbugs.gnu.org; Mon, 21 Feb 2022 04:07:26 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1645434438;
 bh=7r/CbLA8IwkBnX1X9rQz0EhIEps+H0hIhmIY6lYuHks=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To;
 b=Sfj8pyjJZyc1j+i4nu63ctIUXEnymv1e8nPSmEw9VY5K5VEBLrQVOvSSOTWBUQUMr
 rMM8v9aDLFNrJDDp1rBMKsanAt4dgOp1Eujz6Q//jtz0lPYsNTojxn+XreWPNmnV17
 6HFBguOnGEDLKyZRSHMyz8kqA8t0wwUeZcfaFSZo=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.102] ([212.95.5.226]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M2f5T-1nOYIr2rgV-0049Zi; Mon, 21
 Feb 2022 10:07:18 +0100
Message-ID: <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
Date: Mon, 21 Feb 2022 10:07:15 +0100
MIME-Version: 1.0
Content-Language: en-US
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86sfsewvxr.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:Hh9PxlE7c6RDaqe/LjDpzkqjUnPJRBbT6lPcY2zIzcnJ5PyE2rO
 tnu5PCQI5ElTQB2enpJsT8m90KN0TGiBxMKbVLE+pTSsIrXhnFQkwW1rV40sxfjaM7LSTcb
 WAvxrrj7MYpjzfQ3cWjrd+gUQvp1zXaK2xf0IQOagGvZwbrIRAUhlizjvq7Cszy30+yCdIC
 BvgBTqJC/WZofVf6RMznw==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:lx8/6Qc/Cgs=:LjOEMDoxsv2ojrZWmiQX+A
 t5jeZkbm0hbdOv1eUJZdBDiBJ/YK4nISnHiFD0UNADso6C2KsKPO5zkoCtbBOSRNwkypyX9rf
 wtn+wsUtUPotUd/szmOg+nz55jJ+1GWXS5uv5bGoqz1ujArvvRnQ4J3wyGxRaqlQgmYltAROW
 G1AP0YwnoOmtYKL3bA71qVKt6SIqvYL7VD45+diLjBP51CSg7TZUzSkLpRT45ar6gnXumL9e+
 4s9MnAjviiSV9YaP7T7Wa+Jx7XLZX/UEXRsDqFd4qVVRvKuVMX3xvMzQ4hDLTwY6XttaDR6zr
 v/P5uRbPOg+pGeNoLgADp549RZb42Nz5ttPK3rvnOPC6xGsVIvwbWQmiaI75j2u0YQMx1Yp8m
 YCuPv6ML2unxzA7nkK+1FhgSAP8BDP07xnuZQovMj4s0XEKzs8MC/f0SDMpyS2zYkHhuTUjlR
 Lq+5UQ9o7DLSe/lu6dd0snwW13I+Ma20uAyihstGeyc058GTIYyDc5S6p+7zLpiQULaw651Ar
 vFJlcu1Cu4EWkPLFMxe15yOWWpI3DVbSb3qJ7987yxfMTqppGXvPnr3zK/j75WJJoIFSTn9YJ
 LID5PDJSfyHdsJV/tBCJCcywzYOjh5QinniY2J/tqrukD5Q5aXVfDUjL1/822QxcBnrfxqtgy
 rtdil3kz0F5cvdcVpaP4OJDIH8wA/ziIKyOmPRkM4NZ6ccm5BK/2olfHttOePSEAFqDknEZlo
 O7bmjqr1dxb7BPpuWK7e/iysOc3KOVk7XJlhWtVp/SbOSoIXqhnlR4iDhAc8HVe+USp+LzN9o
 EVTj08mby56HxvJnyBkjQTLuwg2xETh6MU1fhc5bfGSFx628vI4lAH0AEUoylbiM5cUqAGOCy
 FZcjIyPxjc2HYgrWrfR4d+a9Z+q3EwkFSlSFlXaRseAOR4hhgVWqODSf8u7NKbf60oX3A4+O/
 7GdTMs7wfjXcNiypuHdnCpyfT2MjmrTxKsk8epJEYnsNCOQaC/SOZY/3TPzkfEC0DW2zP7dXW
 Oc4PPyvh1PDIEVWy8HX2NbE+QqeCXy+ZyKQjxoHl1RRL9SXlxyCSqNg/WxuG/5OSbpzI8Wnrx
 LjAkplX3bBl8bA=
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 >> How would 'save-window-excursion' handle the case of a dired buffer that
 >> gets reverted while its FORMS are run?
 >
 > 'dired-goto-file' will restore dired-positions after 'save-window-excursion'.

Who calculated those dired-positions and who calls 'dired-goto-file' to
restore them?

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 22 Feb 2022 17:29:01 +0000
Resent-Message-ID: <handler.33871.B33871.164555088314994 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.164555088314994
          (code B ref 33871); Tue, 22 Feb 2022 17:29:01 +0000
Received: (at 33871) by debbugs.gnu.org; 22 Feb 2022 17:28:03 +0000
Received: from localhost ([127.0.0.1]:42545 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nMYxG-0003tb-N7
	for submit <at> debbugs.gnu.org; Tue, 22 Feb 2022 12:28:03 -0500
Received: from relay2-d.mail.gandi.net ([217.70.183.194]:64369)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1nMYxD-0003sV-7e
 for 33871 <at> debbugs.gnu.org; Tue, 22 Feb 2022 12:27:59 -0500
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id DB15940009;
 Tue, 22 Feb 2022 17:27:50 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
Date: Tue, 22 Feb 2022 19:14:27 +0200
In-Reply-To: <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN> (martin rudalics's
 message of "Mon, 21 Feb 2022 10:07:15 +0100")
Message-ID: <86fsoaq4lo.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>>> How would 'save-window-excursion' handle the case of a dired buffer that
>>> gets reverted while its FORMS are run?
>>
>> 'dired-goto-file' will restore dired-positions after 'save-window-excursion'.
>
> Who calculated those dired-positions and who calls 'dired-goto-file' to
> restore them?

Like in bug#54038 (about having access to windows in window configurations),
the problem is that there is no way to update and even peek inside
a window configuration.  In bug#54038 the cleanup function can't tell
if a window is still live in a window configuration.

And here 'dired-revert' can't update windows saved in a window configuration.

'dired-save-positions' goes to great lengths to employ get-buffer-window-list,
and walk-windows with window-prev-buffers to update the Dired buffer
even in window-prev-buffers.  And 'dired-restore-positions' with the
same number of lines tries to restore all prev-buffers.

But still 'dired-revert' fails to update the Dired buffer in
window configurations saved in tabs, or in winner.el, or
in 'C-x r w' (window-configuration-to-register), etc.

A possible solution would be to add two hooks:

1. hook before finishing 'current-window-configuration' that will add all
windows to some variable that the cleanup function could check in bug#54038.
This is like 'dired-save-positions'.

2. hook after calling 'set-window-configuration' that will restore
previous positions.  This is like 'dired-restore-positions' that
uses 'dired-goto-file'.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 23 Feb 2022 09:32:02 +0000
Resent-Message-ID: <handler.33871.B33871.164560871022071 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.164560871022071
          (code B ref 33871); Wed, 23 Feb 2022 09:32:02 +0000
Received: (at 33871) by debbugs.gnu.org; 23 Feb 2022 09:31:50 +0000
Received: from localhost ([127.0.0.1]:43815 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nMnzx-0005jv-VN
	for submit <at> debbugs.gnu.org; Wed, 23 Feb 2022 04:31:50 -0500
Received: from mout.gmx.net ([212.227.17.22]:37455)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1nMnzw-0005jb-Gf
 for 33871 <at> debbugs.gnu.org; Wed, 23 Feb 2022 04:31:48 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1645608702;
 bh=yClijdD0qr/lPoKe7vf+WUoCl6T/Z/Z0oDXW4xcEH20=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To;
 b=WKRYmoAoORU2ld1Fpt2TIeiKhB7e6M3P7FLcUOLyYGogqIIAdirI0uB6L+SHaWQae
 Ho4XZ+GBIL8LvGC+5pywpYEphZKZTeEyIu8P0wAhrbQbcH7mwZgs5+hgM5BiVgOcf0
 vEJ66O/dfQlla2Fg8eXHDeTfGmvVJOuhzIqfLCk0=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.101] ([213.142.97.235]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MvsEx-1oCZ4L1YLn-00sx63; Wed, 23
 Feb 2022 10:31:42 +0100
Message-ID: <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
Date: Wed, 23 Feb 2022 10:31:41 +0100
MIME-Version: 1.0
Content-Language: en-US
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86fsoaq4lo.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:ehwbSWEXQaS+fq2bu5OvcZ57pYb/8GlQ6shyiIYUpnummY/oibK
 Egg1V14IsgoRc4QhjpsFiD506cPPPXaPAG5bJIbSBskEaKTYnF4oE9g+WbamCRbARiwSoA5
 XwZQCFtUbkMKSzG3BooDXELls+SNHKhOpLz0brnexy0HLwDcJhBccDo9z47MjQMPQg18VzP
 4lylpWhojtZ45rqsUijpA==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:3rSx3hUoZTE=:tMiwJChS302YeHJM84aJmF
 6V4QrApnYUFLWXEf2zsyR1ZjTGpLABE90dGMW6Fsda9rOzvIN6oeNqXsgiFTI6HJ+sb/8Gs6U
 CDSHmQHSqSisTb0cZnuj7k7EvYd4689auhQIXxz35qGO88o0spfos3b/eZkgjr0uGN9fkHRWi
 40iugcmWqoxPA66QW/UfKR9N08Y2eHY8KCasblPwBKh4gWEY8J42tDSFRS7QnKzSY0e9xet/0
 q9YvkvQTy+UvQebRF3aUu1VDWVU53GEHjxBGXgJ8GQbnmIz6i9aKCcgkD7gfCtDFK6yX65Zji
 rdQ5231oaUuzWwncwKGZHAwiWbCDVynPsL9ULmu5P93+MQsdUWGdtImzBAVaNt+ab+bkGhFrg
 kPkiZP1EUAtnWU2GnZUH2nuMCVcU7pgSyMY6iY9eq9r5m7e6+Na/njuSGYQwC88u+5svWoovK
 worqEBWXN7X9VgD6PQGxYsHzsXxOinVvymlmDLzvfrSFdbNOmImQw/i9KOnoxxsIjg3HzMbvs
 CsaSr7/8pRHgEGr+27+yvKZEciIPoaFbO/oRWzGj/Gpok3kzJ6eDjDWcAUT3evtG6Sudt/NRU
 EKm6okDC9NoPiL7E5SnOm9m1Tc5Tgmne6gy4ukzLdXuxw3+HBOVsRN4hp1xtWWEMtLcrPlB/Z
 JGVlIPWP3tN9awT2H9ypbzcffpyYN6NIaxYCiWg26lkJwmfHj0chu4KkhPyevi+3auNf6iWkR
 WKCPEZ3DVbDzRqrx9B1vgc3ks4GvzqIRJq/H4VaCWGeU8aOrMGQH/6BneIW1sQa4RxKLy7VG/
 Hgeg0K1XHIi8v/kuyFmrgRV3SRkzB5Fb8qoqdAdz2nYHovAM4I9oc7wCdIQgUr/+4NHzQLZcC
 aUAr877P9/yYCsiuN3PzUStGyq3w344JL1lB7TUmf/tuh4iTi4mxLFiNLWQGL+kD8frmQvI+D
 uwPTq5t1zVMAh1en0sjKr97suPIoYTxCiw0bBnge73aceUQGYy4yu/lKBOtqjE4mKwITcqMcr
 ZeAickemiAZKOvHJPKy6F5TlQ+mPQhjOb4VscuJ9WRF2tAT1xd+GJAv8hyisgjN1WALqmqTOd
 JnJuQyx99xWQB4=
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > Like in bug#54038 (about having access to windows in window configurations),
 > the problem is that there is no way to update and even peek inside
 > a window configuration.  In bug#54038 the cleanup function can't tell
 > if a window is still live in a window configuration.

We might be able to provide such a function but can you tell me why you
would need it and how you would use it?

 > And here 'dired-revert' can't update windows saved in a window configuration.

Updating window configurations can be hairy.  We have no function for
testing the validity of a configuration - we simply rely on the fact
that it is a 1-to-1 copy of original sizes and parent-child
relationships.  For example: When we resize a window we check the new
sizes of all windows on that frame before storing them.  When we restore
a window configuration, we simply store back the old sizes and then
maybe try to resize the windows if the frame size changed in between.

 > 'dired-save-positions' goes to great lengths to employ get-buffer-window-list,
 > and walk-windows with window-prev-buffers to update the Dired buffer
 > even in window-prev-buffers.  And 'dired-restore-positions' with the
 > same number of lines tries to restore all prev-buffers.
 >
 > But still 'dired-revert' fails to update the Dired buffer in
 > window configurations saved in tabs, or in winner.el, or
 > in 'C-x r w' (window-configuration-to-register), etc.

As a first step we could try to do that for window states.

 > A possible solution would be to add two hooks:
 >
 > 1. hook before finishing 'current-window-configuration' that will add all
 > windows to some variable that the cleanup function could check in bug#54038.
 > This is like 'dired-save-positions'.

We can easily add such a hook - an abnormal, buffer local one probably
that would be set by dired whenever it shows a directory in a window and
could get as argument the frame and/or the window(s) and probably the
return value of 'current-window-configuration' so dired can match it
with later invocations of 'set-window-configuration'.

 > 2. hook after calling 'set-window-configuration' that will restore
 > previous positions.  This is like 'dired-restore-positions' that
 > uses 'dired-goto-file'.

We can do that in a similar fashion.  But: Updating your "variable" when
dired does something (like copying, deleting or renaming files) would
still have to be synchronized with the position of, for example,
'window-point' in that window when the window is still live at the time
'set-window-configuration' is called.  So we might need yet another hook
called at the beginning of 'set-window-configuration' that allows dired
to check whether the window stored in your variable is live, take the
position of point from there if it is and keep it in the second hook.

(Note in this context: We traditionally say in the Elisp manual that "As
a special exception, the window configuration does not record the value
of point in the selected window for the current buffer." which is not
precise IIUC.  It does record the value but 'set-window-configuration'
does not or not necessarily restore it.)

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 23 Feb 2022 18:07:01 +0000
Resent-Message-ID: <handler.33871.B33871.164563959222151 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.164563959222151
          (code B ref 33871); Wed, 23 Feb 2022 18:07:01 +0000
Received: (at 33871) by debbugs.gnu.org; 23 Feb 2022 18:06:32 +0000
Received: from localhost ([127.0.0.1]:46438 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nMw24-0005lC-BI
	for submit <at> debbugs.gnu.org; Wed, 23 Feb 2022 13:06:32 -0500
Received: from relay8-d.mail.gandi.net ([217.70.183.201]:32991)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1nMw21-0005kj-RW
 for 33871 <at> debbugs.gnu.org; Wed, 23 Feb 2022 13:06:30 -0500
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id 8DE411BF208;
 Wed, 23 Feb 2022 18:06:22 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
Date: Wed, 23 Feb 2022 19:53:14 +0200
In-Reply-To: <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN> (martin rudalics's
 message of "Wed, 23 Feb 2022 10:31:41 +0100")
Message-ID: <86tucp7dbp.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> But still 'dired-revert' fails to update the Dired buffer in
>> window configurations saved in tabs, or in winner.el, or
>> in 'C-x r w' (window-configuration-to-register), etc.
>
> As a first step we could try to do that for window states.

But window states don't contain pointers to windows.
So it's impossible to find e.g. '(selected-window)'
in a window state returned by '(window-state-get)'.

> (Note in this context: We traditionally say in the Elisp manual that "As
> a special exception, the window configuration does not record the value
> of point in the selected window for the current buffer." which is not
> precise IIUC.  It does record the value but 'set-window-configuration'
> does not or not necessarily restore it.)

Then we could save additional context information the same way as
currently this special exceptional value of point is saved, e.g.
in 'tab-bar--tab':

      (wc . ,(current-window-configuration))
      (wc-point . ,(point-marker))

where 'point-marker' is saved separately from 'current-window-configuration'.
And then it's restored in 'tab-bar-select-tab':

            ;; set-window-configuration does not restore the value of
            ;; point in the current buffer, so restore it separately.
            (when (and (markerp wc-point)
                       (marker-buffer wc-point)
                       ;; FIXME: After dired-revert, marker relocates to 1.
                       ;; window-configuration restores point to global point
                       ;; in this dired buffer, not to its window point,
                       ;; but this is slightly better than 1.
                       ;; Maybe better to save dired-filename in each window?
                       (not (eq 1 (marker-position wc-point))))
              (goto-char wc-point))

Please note that this bug report is related to FIXME above.

So a possible solution is also to save more context information
like dired-filename, and then restore it using dired-goto-file.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 24 Feb 2022 09:20:03 +0000
Resent-Message-ID: <handler.33871.B33871.16456943674443 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.16456943674443
          (code B ref 33871); Thu, 24 Feb 2022 09:20:03 +0000
Received: (at 33871) by debbugs.gnu.org; 24 Feb 2022 09:19:27 +0000
Received: from localhost ([127.0.0.1]:47516 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nNAHW-00019b-QZ
	for submit <at> debbugs.gnu.org; Thu, 24 Feb 2022 04:19:27 -0500
Received: from mout.gmx.net ([212.227.17.21]:53785)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1nNAHU-00019O-CH
 for 33871 <at> debbugs.gnu.org; Thu, 24 Feb 2022 04:19:24 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1645694358;
 bh=b+fDyR3oN7Tok1YzkxWKo/ybCiK+DDPHA7IuzmrPZVM=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To;
 b=QAGLiAw93JSxaUmx/NFa2R1IuIpLVD4am3BPOA50hrL1xbWWNwSYeQc1p2+zk+1Xz
 UShVJ5jU6yG67hdkyze10E+WpokxV2Di4wtXAhp59FnXQCRDPkmarchVVcE+WuOgNY
 xNOqFD2LHVA5LXBOkCdMYy4M8yfFKnrGlOkDcTo0=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.101] ([212.95.5.227]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1McYCb-1nxJJT1Sbl-00cv70; Thu, 24
 Feb 2022 10:19:18 +0100
Message-ID: <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
Date: Thu, 24 Feb 2022 10:19:17 +0100
MIME-Version: 1.0
Content-Language: en-US
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86tucp7dbp.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:6lL88eAND5ROCJis46m43nh4c7If/z/MjFGo1eHiFLzoR5paqdX
 PQjgcnQjOpBQL/wJKtY4fXqlxBkWEnh6v+KtOOaoKYE4QDHRk47irPPXujLElpIJij8Dypa
 wRqFFcNYrprSRb+LxwPdDm9zJmuF3bA+Xbnes2p8GFlApW25JVkcAiyBdlCw66upZEJlXTq
 Squ1DcM1N1ROYBdq1VC3w==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:eE93tlBqIus=:N6sfhtPELBviOWtlMrWiGs
 iin4vGIWhB3yquXJcP736QvPEajYMYkEpitRbNRgLbPff+9Q9Fd4nTBovzbzXG4ydgrFcjfaF
 c7Xn0fIZRNKiXXZemyiNQbGgxNfDbOLeq6boWPQFWTicm/ZQtNUjqKYPUzss9UM/WU4Wtwe4C
 aCJotzCawnFZzVviDK6mZpQZW644QSPnZhnOAFZO0LGmR8cXT4wwBYCsOkY8EPz5wROfs97xt
 4mqjS6zK21MmaEydNfsAs9UySU+PjiI8mt6Tt7WwbTiaBAse/oqdEEaCQD/JOsFnuiDyBa5Qn
 PX3FLIoTYyIiI6NOcgh6XYu21f0GE/pvROI/aIu9Mmd7QGxEp/wxzOfqBwSm4RoO2qEgPI6qN
 9ZAQnOXqiy2TjcKOujNAZBk4rAUKIyAMPgkcW16MVEVgKZG1NlFJoHdPAxWVURo8sAxvVAhmV
 o3ZMP+i2G7rBMKdRTuUpMAXg+iU7PZ2kgWfijAqxXSXutpgiYp3vNeHMeu09yt1fmr0iIfKIS
 LtMfxO2bf+kSK99c8jMYYbw915yLYJ+kNI+dzSZYAXieHQyOwuwEGj5p3kZURDH01H/Xo/L3D
 YX1f9iYmFvS990HaKZO2CW04137oGdkf+WWoVaNWOumZP2kurOmXroEniQZvFJcd483MGZr1h
 ntz5fhVTllEM0oMADFooklElN1HkafBpJZpMdMJpAC559CcEZ2ylHLosGMQAdYUlwqnfg0Nqb
 iACMKjYdQRdTOvp9ikOeqPYYcoScSq3c2lsgHdgNe/9pYkn2SQeHj6anPgnEDDNdXjwKMFxt1
 /vYPAoEUkgigi3YXcYry5Mco3PL09TGpxkmm5jfbF/khZGEu+i5zfsJ1pVNpmclPk5/Q7I2hR
 sNi5eHV9oyB67gSLypCZLWEC2JVCkfYtO2/rgjL76J0e8ob+yjarDrJxHyZWayCQUYM7PtRCB
 yvjvaQJCSSbvph2jKT+dVY8G/2AynKjv1dyZ+UO3s+O6b+OhRda7106xL6JSQ4R0tgvHg+Rph
 E/JtU3Qy4EIvcopuSbHjS7Bd8mbuh63IG4gZ70qUmb1y87wpu1EKjFZ4ypRMtoP4uLjrD+G4j
 7D/Uqp/Vgcvhv4=
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > But window states don't contain pointers to windows.
 > So it's impossible to find e.g. '(selected-window)'
 > in a window state returned by '(window-state-get)'.

But you can easily write a function to inspect a window state.

 > Then we could save additional context information the same way as
 > currently this special exceptional value of point is saved, e.g.
 > in 'tab-bar--tab':
 >
 >        (wc . ,(current-window-configuration))
 >        (wc-point . ,(point-marker))
 >
 > where 'point-marker' is saved separately from 'current-window-configuration'.
 > And then it's restored in 'tab-bar-select-tab':
 >
 >              ;; set-window-configuration does not restore the value of
 >              ;; point in the current buffer, so restore it separately.
 >              (when (and (markerp wc-point)
 >                         (marker-buffer wc-point)
 >                         ;; FIXME: After dired-revert, marker relocates to 1.
 >                         ;; window-configuration restores point to global point
 >                         ;; in this dired buffer, not to its window point,
 >                         ;; but this is slightly better than 1.
 >                         ;; Maybe better to save dired-filename in each window?
 >                         (not (eq 1 (marker-position wc-point))))
 >                (goto-char wc-point))
 >
 > Please note that this bug report is related to FIXME above.
 >
 > So a possible solution is also to save more context information
 > like dired-filename, and then restore it using dired-goto-file.

We obviously then should strive for a solution that stores any kind of
information via a hook in an alist of entries, one for each window in a
buffer local way, and one global entry for the frame itself.

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 16 Feb 2024 07:41:02 +0000
Resent-Message-ID: <handler.33871.B33871.170806920822532 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.170806920822532
          (code B ref 33871); Fri, 16 Feb 2024 07:41:02 +0000
Received: (at 33871) by debbugs.gnu.org; 16 Feb 2024 07:40:08 +0000
Received: from localhost ([127.0.0.1]:57824 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1raspL-0005rL-P7
	for submit <at> debbugs.gnu.org; Fri, 16 Feb 2024 02:40:08 -0500
Received: from relay9-d.mail.gandi.net ([217.70.183.199]:37067)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1raspI-0005qm-TY
 for 33871 <at> debbugs.gnu.org; Fri, 16 Feb 2024 02:40:06 -0500
Received: by mail.gandi.net (Postfix) with ESMTPSA id 844BCFF809;
 Fri, 16 Feb 2024 07:39:18 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN> (martin rudalics's
 message of "Thu, 24 Feb 2022 10:19:17 +0100")
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
Date: Fri, 16 Feb 2024 09:37:39 +0200
Message-ID: <86zfw07tbw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -2.6 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.6 (---)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

>>              ;; set-window-configuration does not restore the value of
>>              ;; point in the current buffer, so restore it separately.
>>              (when (and (markerp wc-point)
>>                         (marker-buffer wc-point)
>>                         ;; FIXME: After dired-revert, marker relocates to 1.
>>                         ;; window-configuration restores point to global point
>>                         ;; in this dired buffer, not to its window point,
>>                         ;; but this is slightly better than 1.
>>                         ;; Maybe better to save dired-filename in each window?
>>                         (not (eq 1 (marker-position wc-point))))
>>                (goto-char wc-point))
>>
>> Please note that this bug report is related to FIXME above.
>>
>> So a possible solution is also to save more context information
>> like dired-filename, and then restore it using dired-goto-file.
>
> We obviously then should strive for a solution that stores any kind of
> information via a hook in an alist of entries, one for each window in a
> buffer local way, and one global entry for the frame itself.

Here is the patch that stores any kind of information via a hook,
one for each window in a buffer local way.

Currently only dired positions for the revert case are supported.
But also I tried to save context of any buffer in a bookmark way,
and this works nicely, and correctly restores old positions even
from window states from the desktop:

#+begin_src emacs-lisp
;; Like ‘bookmark-make-record-default’:
(setq-default window-set-context-function
              (lambda ()
                `((front-context-string
                   . ,(buffer-substring-no-properties
                       (point) (min (+ (point) 16) (point-max))))
                  (rear-context-string
                   . ,(buffer-substring-no-properties
                       (point) (max (- (point) 16) (point-min)))))))
;; Like ‘bookmark-default-handler’:
(setq-default window-use-context-function
              (lambda (context)
                (when (search-forward (alist-get 'front-context-string context)
                                      (point-max) t)
                  (goto-char (match-beginning 0)))
                (when (search-backward (alist-get 'rear-context-string context)
                                       (point-min) t)
                  (goto-char (match-end 0)))))
#+end_src


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=window-context-function.patch

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 3e1d8278b04..fc1b20287d3 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1283,6 +1283,10 @@ frameset-filter-tabs
 
 (push '(tabs . frameset-filter-tabs) frameset-filter-alist)
 
+(defvar window-set-context-function nil)
+(defvar window-use-context-function nil)
+(add-to-list 'window-persistent-parameters '(context . writable))
+
 (defun tab-bar--tab (&optional frame)
   "Make a new tab data structure that can be added to tabs on the FRAME."
   (let* ((tab (tab-bar--current-tab-find nil frame))
@@ -1292,6 +1296,14 @@ tab-bar--tab
                                            frame 'buffer-list)))
          (bbl (seq-filter #'buffer-live-p (frame-parameter
                                            frame 'buried-buffer-list))))
+    (walk-windows
+     (lambda (w)
+       (with-selected-window w
+         (when (functionp window-set-context-function)
+           (when-let ((context (funcall window-set-context-function)))
+             (set-window-parameter w 'context (cons (buffer-name) context))))))
+     'nomini)
+
     `(tab
       (name . ,(if tab-explicit-name
                    (alist-get 'name tab)
@@ -1479,6 +1491,15 @@ tab-bar-select-tab
             (select-window (get-mru-window)))
           (window-state-put ws nil 'safe)))
 
+        (walk-windows
+         (lambda (w)
+           (with-selected-window w
+             (when-let ((context (window-parameter w 'context)))
+               (when (and (functionp window-use-context-function)
+                          (equal (buffer-name) (car context)))
+                 (funcall window-use-context-function (cdr context))))))
+         'nomini)
+
         ;; Select the minibuffer when it was active before switching tabs
         (when (and minibuffer-was-active (active-minibuffer-window))
           (select-window (active-minibuffer-window)))
diff --git a/lisp/dired.el b/lisp/dired.el
index 9e3b888df14..df50f37df7b 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2743,6 +2745,12 @@ dired-mode
               '(dired-font-lock-keywords t nil nil beginning-of-line))
   (setq-local desktop-save-buffer 'dired-desktop-buffer-misc-data)
   (setq-local grep-read-files-function #'dired-grep-read-files)
+  (setq-local window-set-context-function
+              (lambda ()
+                `((dired-filename . ,(dired-get-filename nil t)))))
+  (setq-local window-use-context-function
+              (lambda (context)
+                (dired-goto-file (alist-get 'dired-filename context))))
   (setq dired-switches-alist nil)
   (hack-dir-local-variables-non-file-buffer) ; before sorting
   (dired-sort-other dired-actual-switches t)

--=-=-=--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 16 Feb 2024 09:42:02 +0000
Resent-Message-ID: <handler.33871.B33871.170807648812846 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.170807648812846
          (code B ref 33871); Fri, 16 Feb 2024 09:42:02 +0000
Received: (at 33871) by debbugs.gnu.org; 16 Feb 2024 09:41:28 +0000
Received: from localhost ([127.0.0.1]:57874 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rauim-0003L7-87
	for submit <at> debbugs.gnu.org; Fri, 16 Feb 2024 04:41:28 -0500
Received: from mout.gmx.net ([212.227.17.21]:43389)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1rauil-0003Kw-B0
 for 33871 <at> debbugs.gnu.org; Fri, 16 Feb 2024 04:41:27 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.at; s=s31663417;
 t=1708076462; x=1708681262; i=rudalics@HIDDEN;
 bh=QnReKE184zrXdYGw8aSgXp8+mR5C0IwC2xCJn8W23X4=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:
 In-Reply-To;
 b=B8eVhcY1myjScC+Rqdfx8ssxVdTbUMgQyyasgXeXAuhuxRSEF8zycEOBKcRCV4Kw
 fhtQR5BUyAagt2FHHeBL4Pz2qzj1eSJMih0bl103DmR+ufwzy7lwK+4pK8eFrJ4Xp
 1azOeVSbGDl+8D0Hz2LxyM6Of40II8K4L9pSZOByH4EN1ShsuBVU0u1Wj/OCULpZL
 46e3vf0e46PUem6UnN/FTVKmtPjDHX8La9Li5r0MH1B6iFlO9SWiXCUGBVWq4mjOx
 JFn4J0kvQpJoHSh3CXKmEapb4Nb9cJl5rRWsherGwSMIlGx3ebol6Ye9ObczkwagJ
 5DyxObmgk63QtMKK5g==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([46.125.249.69]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MQ5vc-1rNniP3FTc-00M3Zx; Fri, 16
 Feb 2024 10:41:01 +0100
Message-ID: <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
Date: Fri, 16 Feb 2024 10:41:01 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
References: <87bm59mglk.fsf@HIDDEN> <87fsoo323s.fsf@HIDDEN>
 <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86zfw07tbw.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:U6KKHDjhJmjQKDavrYag0MqYR9zjzAfIlEX91NMeUjvtospFu8d
 c/8SoPp0ZZEUKOC8/Kg1wYbPsTwmeXeQir2qqLgR/xxRVMvGV2n4nNZWzAvDidVPuSF4niJ
 t1h3S+5aqwhSUEUJfnfNt0yssg4QmR94xpJSOUiJxuXsnvXns/5e42x/zoyEmWs1B9DIcQr
 8orPB3p7iAZf9V8q1z0uQ==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:3GK9sxsqqTo=;gKWwXzkNm47tRXASINTU+jIvDFn
 iA+7TIAHDclSoYznBwMYPeuSz6FQiKFhBpTAkCKcsnOnxdTpjqzjiAzSgrX/kifuMMzsnbzIB
 6Oy3KW0blTKcCWZrZQCSfr2RUogPLL8wO5vODdzirlZueGFPBo88rzYvlMLA/iQUYOQXXUi6t
 FdtIMA/eEfXQtOAFvKjz7L0gE/8uwt7GiC3jyntP1FxK6kHEa56VRsoQRLoY6ka5xpoo3Zh/R
 29zBe4xenBrrG/nC3g4Ykfd81kOIITGF8flGeeHO8dmnPcQZvtvltA6Fd9jVGEOkXdtuP3kBF
 X72qzZrugxB7+n6fJXb0KP2+2e2jXmP+q9MxOorVB5VuIraV1y1OT6E7HyvUncFPWEh7Q2D/Z
 r6TmnJ4jgfK7+xqwKXSpOAtdAqk6LYhG/+Aw71Ou2c/35wNGf5Z0Zooc7C/3uCB6sAEVizMoB
 dmsNFE2l2fkSKXhh/98HRDe3t9caa6Oon5CqxRxbqK1itrj5KSmdhE/xKgwh9VpA70UdTqxC7
 0iknNSpHNxKpt61lLDBm+x76eGJUl7bMIZ8SQuNTwDTyrLXONVGddVmCMS7pYPCo46dpeTcWY
 qzQF/QYEZRbhGJfoUcouFlAQh8foGvAFU2OQH2DOgx8qBYFFU/RWVxQkNsYr94rdspOd6z1jh
 //sqbkc8kB2XblV+XI/Ier03VekIOTCnnmX2CKnPITSrVT2CQMaWGBJVEnihybEaSg2ASzPls
 y4Y2kFdDgNLWKHjqr3JIv+Zgvmx43urNK4SzwCh9jcBzFx+OO/J9e11zxelfvzzWMXepDDHhr
 tVyxyLQi+DYdOoymDvt3zV3F05eWCTqKh3gDJ24RsLCsk=
X-Spam-Score: 0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

 > Here is the patch that stores any kind of information via a hook,
 > one for each window in a buffer local way.
 >
 > Currently only dired positions for the revert case are supported.
 > But also I tried to save context of any buffer in a bookmark way,
 > and this works nicely, and correctly restores old positions even
 > from window states from the desktop:

Note that

+       (with-selected-window w
+         (when (functionp window-set-context-function)

and

+           (with-selected-window w
+             (when-let ((context (window-parameter w 'context)))

would set up a precedence case for the future use of
'window-set-context-function'.  Are you sure that you always want to
select the window in question here or would it suffice to pass the
window as argument to the context function?

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 18 Feb 2024 07:49:01 +0000
Resent-Message-ID: <handler.33871.B33871.170824248414280 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.170824248414280
          (code B ref 33871); Sun, 18 Feb 2024 07:49:01 +0000
Received: (at 33871) by debbugs.gnu.org; 18 Feb 2024 07:48:04 +0000
Received: from localhost ([127.0.0.1]:34121 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rbbu7-0003iF-Ir
	for submit <at> debbugs.gnu.org; Sun, 18 Feb 2024 02:48:04 -0500
Received: from relay8-d.mail.gandi.net ([217.70.183.201]:43417)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1rbbu5-0003hV-ML
 for 33871 <at> debbugs.gnu.org; Sun, 18 Feb 2024 02:48:02 -0500
Received: by mail.gandi.net (Postfix) with ESMTPSA id 4B0691BF203;
 Sun, 18 Feb 2024 07:47:13 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN> (martin rudalics's
 message of "Fri, 16 Feb 2024 10:41:01 +0100")
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
Date: Sun, 18 Feb 2024 09:39:31 +0200
Message-ID: <86wmr2w7to.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -2.6 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.6 (---)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

> +       (with-selected-window w
> +         (when (functionp window-set-context-function)
>
> and
>
> +           (with-selected-window w
> +             (when-let ((context (window-parameter w 'context)))
>
> would set up a precedence case for the future use of
> 'window-set-context-function'.  Are you sure that you always want to
> select the window in question here or would it suffice to pass the
> window as argument to the context function?

Ok, let's add the WINDOW argument.  This means that most hooks
will need to call 'with-selected-window' explicitly.  But maybe
there will be hooks that don't need to select a window.

So here how a bookmark-like default context could look.
I'm still not sure whether it's a good idea to enable this
by default.

#+begin_src emacs-lisp
;; Like ‘bookmark-make-record-default’
(setq-default window-set-context-function
              (lambda (w)
                (with-selected-window w
                  `((front-context-string
                     . ,(buffer-substring-no-properties
                         (point) (min (+ (point) 16) (point-max))))
                    (rear-context-string
                     . ,(buffer-substring-no-properties
                         (point) (max (- (point) 16) (point-min))))))))
;; Like ‘bookmark-default-handler’
(setq-default window-use-context-function
              (lambda (w context)
                (with-selected-window w
                  (when-let ((f (alist-get 'front-context-string context)))
                    (search-forward f (point-max) t)
                    (goto-char (match-beginning 0)))
                  (when-let ((r (alist-get 'rear-context-string context)))
                    (search-backward r (point-min) t)
                    (goto-char (match-end 0))))))
#+end_src

And here is the patch that at least handles the dired revert.


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=window-context-function.patch

diff --git a/lisp/dired.el b/lisp/dired.el
index 9e3b888df14..dd397eb5c46 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2743,6 +2745,19 @@ dired-mode
               '(dired-font-lock-keywords t nil nil beginning-of-line))
   (setq-local desktop-save-buffer 'dired-desktop-buffer-misc-data)
   (setq-local grep-read-files-function #'dired-grep-read-files)
+  (setq-local window-set-context-function
+              (lambda (w)
+                (with-selected-window w
+                  (if-let ((f (dired-get-filename nil t)))
+                      `((dired-filename . ,f))
+                    `((position . ,(point)))))))
+  (setq-local window-use-context-function
+              (lambda (w context)
+                (with-selected-window w
+                  (if-let ((f (alist-get 'dired-filename context)))
+                      (dired-goto-file f)
+                    (when-let ((p (alist-get 'position context)))
+                      (goto-char p))))))
   (setq dired-switches-alist nil)
   (hack-dir-local-variables-non-file-buffer) ; before sorting
   (dired-sort-other dired-actual-switches t)
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 3e1d8278b04..7718262acbb 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1283,6 +1283,10 @@ frameset-filter-tabs
 
 (push '(tabs . frameset-filter-tabs) frameset-filter-alist)
 
+(defvar window-set-context-function nil)
+(defvar window-use-context-function nil)
+(add-to-list 'window-persistent-parameters '(context . writable))
+
 (defun tab-bar--tab (&optional frame)
   "Make a new tab data structure that can be added to tabs on the FRAME."
   (let* ((tab (tab-bar--current-tab-find nil frame))
@@ -1292,6 +1296,14 @@ tab-bar--tab
                                            frame 'buffer-list)))
          (bbl (seq-filter #'buffer-live-p (frame-parameter
                                            frame 'buried-buffer-list))))
+    (walk-windows
+     (lambda (w)
+       (when-let (((functionp window-set-context-function))
+                  (context (funcall window-set-context-function w)))
+         (set-window-parameter
+          w 'context (cons (buffer-name (window-buffer w)) context))))
+     'nomini)
+
     `(tab
       (name . ,(if tab-explicit-name
                    (alist-get 'name tab)
@@ -1479,6 +1491,14 @@ tab-bar-select-tab
             (select-window (get-mru-window)))
           (window-state-put ws nil 'safe)))
 
+        (walk-windows
+         (lambda (w)
+           (when-let (((functionp window-use-context-function))
+                      (context (window-parameter w 'context))
+                      ((equal (buffer-name (window-buffer w)) (car context))))
+             (funcall window-use-context-function w (cdr context))))
+         'nomini)
+
         ;; Select the minibuffer when it was active before switching tabs
         (when (and minibuffer-was-active (active-minibuffer-window))
           (select-window (active-minibuffer-window)))

--=-=-=--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 19 Feb 2024 09:44:02 +0000
Resent-Message-ID: <handler.33871.B33871.17083357987507 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.17083357987507
          (code B ref 33871); Mon, 19 Feb 2024 09:44:02 +0000
Received: (at 33871) by debbugs.gnu.org; 19 Feb 2024 09:43:18 +0000
Received: from localhost ([127.0.0.1]:40343 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rc0BB-0001x1-SJ
	for submit <at> debbugs.gnu.org; Mon, 19 Feb 2024 04:43:18 -0500
Received: from mout.gmx.net ([212.227.17.22]:46341)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1rc0B8-0001wm-MG
 for 33871 <at> debbugs.gnu.org; Mon, 19 Feb 2024 04:43:15 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.at; s=s31663417;
 t=1708335767; x=1708940567; i=rudalics@HIDDEN;
 bh=mAuYjKc4odmZ5yYHb9M6j+86B+3zO7fgS/J6CavJy9Y=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:
 In-Reply-To;
 b=RlmmQOJXAi909i0gGvdEk0E9YAOg5fV2XjV4e+v39pCs0AthJwMNQMzOQYND4mOL
 5rC0VRTtacaqmiQ6iBOev/U78/yvFAty6cewBkANYx6DGEPOl3ynmHVwFqzwWsq/V
 A8WLlRGloLh65kQAby50iG7uU4cFpvdEosQlQVROk8IDcxKpRgpXBHlcFAfE/3kly
 pj00t2BRwObeOLkfLLHdBsIG7+iAzKGGoDXOAsyb1OxXPPQ5bD7nlJTXPXYo4H90i
 btdsIl+tNimakv6+dYqjx7DTdZ+RSxrGjunsLW7o7+d8Qyzx5YZEvwbWmG6mRH2O6
 QOKIAHkywlnnrpPkxQ==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([46.125.249.97]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MMGNC-1rL1Y81zt8-00JG4G; Mon, 19
 Feb 2024 10:42:46 +0100
Message-ID: <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
Date: Mon, 19 Feb 2024 10:42:46 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
References: <87bm59mglk.fsf@HIDDEN> <86h792x3wv.fsf@HIDDEN>
 <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@HIDDEN>
 <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86wmr2w7to.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:KO/DYhQ9zdL1zz20Lv/qbAu5cac8YKaijIM9Ue6ZQ88z9p23fZy
 TXQIs9Ak4H9DV1knQCGZ9krqiX0BJt2eXXTuMo7mqh+5sl2maPKbwsr2kqabLH5iI+V7N5r
 nZxLZDiVixHzw2BtY1/q+mGEogcwK5Ye+qc+y17FSWzXv9VehpEj3QG6GSHt202NwxcXOHQ
 pjv8ZoY27RUe76SZwrgDw==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:WZFpMQYzwTU=;yrvwwOAYpygG+G8pLbBDdAJJQbZ
 YPjaa8MhWra5YoKewWRKfIOPRoF94MZrlOPi0y6hzYH2tlJdYLYTJrrpY/pGbpCEsC5wqTZJC
 oRULK8WfIGfR7gkllkL/cHjzXU5Y+a4xfkGfor5dYIDZaOlhAH1JhVos/JHyp4oT2guHgb1B7
 I/90kzcW7eXjQybDK0Jw1wWAAwgZ5dWuE+pEAnOZEvZq8jfLfSJCN54M4aAxX8CAOV3xWmogb
 Bj2WwoAPDZNr9izzV1F13EmezuWocRBMSdDlmEzt2124Vy9xo9BCB37N3f5GEZXVmJQItfvTX
 KxZ1r9lNujCjL7czXGsezGNORzoIY+qtR6NJnU8RCxNXt9squ8GwHsOY2kkqFq4FldC9rAdiB
 Mv4tR/bC1zHQ+r4rtm6SykOGDNwsYSzLDzJhQNametSUsia2xSa6o8oQYgUqY+HPZF6CdETig
 Iaz/SriU/8ugKKtJ222WXYUI82oULH4nGAPQSK4GPfkBZnXbhYDUNXq44YFGkAT5fXSoKj4a/
 /7UVo75PNj1pjMMjxvAXwLyk5M3qdcEShlHGc+vkeBTpC+iBCrIuemUZntsBgOBvwey39N9iJ
 GXWkXEWcnDm/nZvNjzdVOK1nISJyDeCQIN/wiodb9d/NOpgTFOjz8bQ4ouLbq/5m3xe1+M5U5
 qZ+2CsjvKYmW8/5xzgG+g5IiLSlpfO9wepV/MOpS8U4NaYrqeyLF3rDB/xwn3QB3XNA1bLL9j
 R2akQvtt3SqIuQwhDYAiwKDwlQCy0g6/aDNO29gmTwYwGH/jmH1L2UjUJuTG8d7mdLfF2RFEs
 /tsFxLv+LRXaV1R5cmHK6kmm6PRoOykODra9VdKVKN3QE=
X-Spam-Score: 0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

 > Ok, let's add the WINDOW argument.  This means that most hooks
 > will need to call 'with-selected-window' explicitly.  But maybe
 > there will be hooks that don't need to select a window.

(setq-default window-set-context-function
               (lambda (w)
		(let ((point (window-point w)))
		  (with-current-buffer (window-buffer w)
                     `((front-context-string
                        . ,(buffer-substring-no-properties
                            point (min (+ point 16) (point-max))))
                       (rear-context-string
                        . ,(buffer-substring-no-properties
                            point (max (- point 16) (point-min)))))))))

should suffice to make 'buffer-substring-no-properties' work.  Note that
if you select the window beforehand, 'selected-window' will not return a
meaningful value in the body of the function called.  This is a problem
of many "hooks" like 'mode-line-format' or 'window-configuration-hook'.
The comfort you get comes at the price of a lack of generality.

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 20 Feb 2024 08:00:02 +0000
Resent-Message-ID: <handler.33871.B33871.170841596223305 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.170841596223305
          (code B ref 33871); Tue, 20 Feb 2024 08:00:02 +0000
Received: (at 33871) by debbugs.gnu.org; 20 Feb 2024 07:59:22 +0000
Received: from localhost ([127.0.0.1]:44232 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rcL2A-00063p-Ev
	for submit <at> debbugs.gnu.org; Tue, 20 Feb 2024 02:59:22 -0500
Received: from relay7-d.mail.gandi.net ([217.70.183.200]:59081)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1rcL27-00063N-2g
 for 33871 <at> debbugs.gnu.org; Tue, 20 Feb 2024 02:59:19 -0500
Received: by mail.gandi.net (Postfix) with ESMTPSA id 59BAF2000E;
 Tue, 20 Feb 2024 07:58:49 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <3808f9f8-624a-449c-8572-085582395859@HIDDEN> (martin rudalics's
 message of "Mon, 19 Feb 2024 10:42:46 +0100")
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
Date: Tue, 20 Feb 2024 09:45:09 +0200
Message-ID: <86y1bffvya.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -2.6 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.6 (---)

>> Ok, let's add the WINDOW argument.  This means that most hooks
>> will need to call 'with-selected-window' explicitly.  But maybe
>> there will be hooks that don't need to select a window.
>
> (setq-default window-set-context-function
>               (lambda (w)
> 		(let ((point (window-point w)))
> 		  (with-current-buffer (window-buffer w)
>                     `((front-context-string
>                        . ,(buffer-substring-no-properties
>                            point (min (+ point 16) (point-max))))
>                       (rear-context-string
>                        . ,(buffer-substring-no-properties
>                            point (max (- point 16) (point-min)))))))))
>
> should suffice to make 'buffer-substring-no-properties' work.  Note that
> if you select the window beforehand, 'selected-window' will not return a
> meaningful value in the body of the function called.  This is a problem
> of many "hooks" like 'mode-line-format' or 'window-configuration-hook'.
> The comfort you get comes at the price of a lack of generality.

Thanks.  Is it possible to avoid 'with-selected-window' in other hooks?
Maybe something like this:

(setq-default window-use-context-function
              (lambda (w context)
                (let ((point (window-point w)))
                  (with-current-buffer (window-buffer w)
                    (goto-char point)
                    (when-let ((f (alist-get 'front-context-string context)))
                      (search-forward f (point-max) t)
                      (goto-char (match-beginning 0)))
                    (when-let ((r (alist-get 'rear-context-string context)))
                      (search-backward r (point-min) t)
                      (goto-char (match-end 0)))
                    (setq point (point)))
                  (set-window-point w point))))

and for Dired:

diff --git a/lisp/dired.el b/lisp/dired.el
index 9e3b888df14..fc8da1635f9 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2743,6 +2745,24 @@ dired-mode
               '(dired-font-lock-keywords t nil nil beginning-of-line))
   (setq-local desktop-save-buffer 'dired-desktop-buffer-misc-data)
   (setq-local grep-read-files-function #'dired-grep-read-files)
+  (setq-local window-set-context-function
+              (lambda (w)
+                (let ((point (window-point w)))
+                  (with-current-buffer (window-buffer w)
+                    (goto-char point)
+                    (if-let ((f (dired-get-filename nil t)))
+                        `((dired-filename . ,f))
+                      `((position . ,(point))))))))
+  (setq-local window-use-context-function
+              (lambda (w context)
+                (let ((point (window-point w)))
+                  (with-current-buffer (window-buffer w)
+                    (if-let ((f (alist-get 'dired-filename context)))
+                        (dired-goto-file f)
+                      (when-let ((p (alist-get 'position context)))
+                        (goto-char p)))
+                    (setq point (point)))
+                  (set-window-point w point))))
   (setq dired-switches-alist nil)
   (hack-dir-local-variables-non-file-buffer) ; before sorting
   (dired-sort-other dired-actual-switches t)




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 21 Feb 2024 09:06:01 +0000
Resent-Message-ID: <handler.33871.B33871.170850634426305 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.170850634426305
          (code B ref 33871); Wed, 21 Feb 2024 09:06:01 +0000
Received: (at 33871) by debbugs.gnu.org; 21 Feb 2024 09:05:44 +0000
Received: from localhost ([127.0.0.1]:47880 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rciXw-0006qD-8a
	for submit <at> debbugs.gnu.org; Wed, 21 Feb 2024 04:05:44 -0500
Received: from mout.gmx.net ([212.227.17.21]:39999)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1rciXs-0006pz-OY
 for 33871 <at> debbugs.gnu.org; Wed, 21 Feb 2024 04:05:42 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.at; s=s31663417;
 t=1708506312; x=1709111112; i=rudalics@HIDDEN;
 bh=rnG0MM/b2RmpRDVvXkYdiCk5/zf/xXrfoq+r/Sz0OR8=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:
 In-Reply-To;
 b=qJncuPTlUjjecl/V8L1o1nQJR7HMufy+/z4MYo51pGcUAcBtuGZVciWp6Rp5eCAN
 M5l1Fidcnyfy8wD1fY1TscuhAQIlrZpqM+zxgk5mOB7NxkoGI/ZW3E1AuiTivEves
 CSuYu141AUIFhDcW5pQM3nDHKeFzLWpEU+JGJVbD7PZIzCahwJ2ttpOeP28XnC+di
 /cFDr6CTKNIIOVYRlyS3opWTFyETlvzNEcpoUSYuEXVP3Jq0ewaZrGLmTHa8aEwOm
 oyXeJeCn+66Nopg4tePeSwiykpDH4SrRiDg2B201EL/6aPTAdDJcCH5vVgmVlCR7R
 FdhPmwbQt8zSZ9eM5Q==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([46.125.249.57]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N1Obb-1qx5O03CO3-012p0i; Wed, 21
 Feb 2024 10:05:11 +0100
Message-ID: <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
Date: Wed, 21 Feb 2024 10:05:11 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
References: <87bm59mglk.fsf@HIDDEN> <861r05co9l.fsf@HIDDEN>
 <ff97e738-66f7-746f-e233-20b0c1409b55@HIDDEN>
 <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86y1bffvya.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:/1RRKr0wHD/K+yGiBeUhqCYeDRuzLacnORdfprJgyIKq7y/r7ot
 NdUhJzE/KZV9INqno6xNTz3iwLA6DhUzuBUtxS2ieHxbZL0+AFLc1Oh1fxjC5nIBDkg0L8R
 nTUfjvxuPR4v7/YVCQZdVxD5HGevd7DqG/rPjQfgjlT8974yw1inIGFC+PSRsoiuFRVWjvL
 0NCmBIaYYXZfg0EUXthnw==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:7MmCeyKrtgE=;rjnRvgLekkye7RPkpelf6xnD1oO
 YGKbEMtxv+tJBnv14653DdelNITGoRfYrOlCMTFQufHSZxk1d8k6r56SkQKPp3lF9S92CZIWR
 n5knhnvlr/JWk3uyExa1b6+efAMluWbjtrEFyiIv3anVd3PmJxK3Zunhy29U40DxEqlzKwy0s
 G6lYHHzRYmQ38LjFIoOc65NQRCrCZM2dZTTgwfO3Cl0mRXdM5Ya7guE7isetRXT+MS5eLTJsd
 XIVGVceIGFNIprlOe/sPnCQXPvZcwx7ag0GMhQQ6bYX1QgNT1WMY0S343poKvC5ZwdKZNHMM+
 VfXLEVVK0yP0KYCmNFnqWtpTf2dVMnm23ePCkeEXXyK5bwTp5n7WegGmNAFB3GJU3yWsanOHK
 7oSvOrCI675vXyHPz3hO2ZHXVIGSncREgWPg+l7UnaeYuKW3WXU2SkbbtciUOXok8mHnDdFh1
 /SA8JEeJPd0Rq/ARtet1Een9RTRN9zny0Q6JDFBtcaZzrKAymHjNsP/JOaIq+c5EODTf8dbxe
 u1HHiCUfI1WTEwpm6w0Vv5q6nnymqKaaO/3byeE9gJ/GUeXR7AlIwZhIHU7J/0WIZtjZU/QPJ
 ES16bF47FnMf/eZmEazVn9dDxzx7/d8J7OEFE/PIvkEhN522NJvlGm1m9W/Lt3op6mRJDNXvV
 qaKCGs53vqwNuRDlYhY1dibMGITaVCDVoV79J1zr0dOwvQMODchimIbvZjCF5XXaaNZIbdYhM
 rroniyarCXSmhGsPCWTFXTrZp9LrhuKE+YkwKMFv/AN1jbxZv8ujCfRsBmlG9H9Ud260oQZYj
 OKEl/WFz0605SOvd+Vcz274fgzmRHCMFTppDUUv0cIDXs=
X-Spam-Score: 0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

 > Thanks.  Is it possible to avoid 'with-selected-window' in other hooks?
 > Maybe something like this:
 >
 > (setq-default window-use-context-function
 >                (lambda (w context)
 >                  (let ((point (window-point w)))
 >                    (with-current-buffer (window-buffer w)

I suppose that in the general case you need a

(save-excursion

from here

 >                      (goto-char point)
 >                      (when-let ((f (alist-get 'front-context-string context)))
 >                        (search-forward f (point-max) t)
 >                        (goto-char (match-beginning 0)))
 >                      (when-let ((r (alist-get 'rear-context-string context)))
 >                        (search-backward r (point-min) t)
 >                        (goto-char (match-end 0)))
 >                      (setq point (point)))

till here

)

 >                  (set-window-point w point))))


Probably something similar is needed for dired, for example to handle
the case where its buffer is simultaneously shown in two windows with
their points on different lines.

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 21 Feb 2024 17:40:03 +0000
Resent-Message-ID: <handler.33871.B33871.170853719014811 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.170853719014811
          (code B ref 33871); Wed, 21 Feb 2024 17:40:03 +0000
Received: (at 33871) by debbugs.gnu.org; 21 Feb 2024 17:39:50 +0000
Received: from localhost ([127.0.0.1]:57165 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rcqZR-0003qn-Ha
	for submit <at> debbugs.gnu.org; Wed, 21 Feb 2024 12:39:49 -0500
Received: from relay5-d.mail.gandi.net ([217.70.183.197]:56325)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1rcqZP-0003q3-0s
 for 33871 <at> debbugs.gnu.org; Wed, 21 Feb 2024 12:39:47 -0500
Received: by mail.gandi.net (Postfix) with ESMTPSA id 396CF1C0007;
 Wed, 21 Feb 2024 17:38:55 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN> (martin rudalics's
 message of "Wed, 21 Feb 2024 10:05:11 +0100")
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
Date: Wed, 21 Feb 2024 19:18:17 +0200
Message-ID: <86v86hwxbe.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -2.6 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.6 (---)

>> (setq-default window-use-context-function
>>                (lambda (w context)
>>                  (let ((point (window-point w)))
>>                    (with-current-buffer (window-buffer w)
>
> I suppose that in the general case you need a
>
> (save-excursion

Thanks.  I just noticed this is broken in two windows case,
and your suggestion fixed it.

> Probably something similar is needed for dired, for example to handle
> the case where its buffer is simultaneously shown in two windows with
> their points on different lines.

So here is the same for dired:

diff --git a/lisp/dired.el b/lisp/dired.el
index 9e3b888df14..0510db1c409 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2743,6 +2745,26 @@ dired-mode
               '(dired-font-lock-keywords t nil nil beginning-of-line))
   (setq-local desktop-save-buffer 'dired-desktop-buffer-misc-data)
   (setq-local grep-read-files-function #'dired-grep-read-files)
+  (setq-local window-set-context-function
+              (lambda (w)
+                (let ((point (window-point w)))
+                  (with-current-buffer (window-buffer w)
+                    (save-excursion
+                      (goto-char point)
+                      (if-let ((f (dired-get-filename nil t)))
+                          `((dired-filename . ,f))
+                        `((position . ,(point)))))))))
+  (setq-local window-use-context-function
+              (lambda (w context)
+                (let ((point (window-point w)))
+                  (with-current-buffer (window-buffer w)
+                    (save-excursion
+                      (if-let ((f (alist-get 'dired-filename context)))
+                          (dired-goto-file f)
+                        (when-let ((p (alist-get 'position context)))
+                          (goto-char p)))
+                      (setq point (point))))
+                  (set-window-point w point))))
   (setq dired-switches-alist nil)
   (hack-dir-local-variables-non-file-buffer) ; before sorting
   (dired-sort-other dired-actual-switches t)




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 20 Mar 2024 17:32:01 +0000
Resent-Message-ID: <handler.33871.B33871.171095589915252 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171095589915252
          (code B ref 33871); Wed, 20 Mar 2024 17:32:01 +0000
Received: (at 33871) by debbugs.gnu.org; 20 Mar 2024 17:31:39 +0000
Received: from localhost ([127.0.0.1]:51986 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rmzms-0003xu-RI
	for submit <at> debbugs.gnu.org; Wed, 20 Mar 2024 13:31:39 -0400
Received: from relay7-d.mail.gandi.net ([217.70.183.200]:44339)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1rmzmp-0003xK-T8
 for 33871 <at> debbugs.gnu.org; Wed, 20 Mar 2024 13:31:36 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id C49BA20002;
 Wed, 20 Mar 2024 17:30:27 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN> (martin rudalics's
 message of "Wed, 21 Feb 2024 10:05:11 +0100")
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
Date: Wed, 20 Mar 2024 19:27:43 +0200
Message-ID: <8634skstio.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain

> Probably something similar is needed for dired, for example to handle
> the case where its buffer is simultaneously shown in two windows with
> their points on different lines.

Avoiding select-window removed simplicity and now requires
adding more handling and more testing.  But finally
everything works correctly.  Please review the new patch:


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=tab-bar-select-restore-context.patch

diff --git a/lisp/dired.el b/lisp/dired.el
index 9e3b888df14..cb2fc97d0ae 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2743,6 +2745,24 @@ dired-mode
               '(dired-font-lock-keywords t nil nil beginning-of-line))
   (setq-local desktop-save-buffer 'dired-desktop-buffer-misc-data)
   (setq-local grep-read-files-function #'dired-grep-read-files)
+  (setq-local window-set-context-function
+              (lambda (w)
+                (let ((point (window-point w)))
+                  (save-excursion
+                    (goto-char point)
+                    (if-let ((f (dired-get-filename nil t)))
+                        `((dired-filename . ,f))
+                      `((position . ,(point))))))))
+  (setq-local window-use-context-function
+              (lambda (w context)
+                (let ((point (window-point w)))
+                  (save-excursion
+                    (if-let ((f (alist-get 'dired-filename context)))
+                        (dired-goto-file f)
+                      (when-let ((p (alist-get 'position context)))
+                        (goto-char p)))
+                    (setq point (point)))
+                  (set-window-point w point))))
   (setq dired-switches-alist nil)
   (hack-dir-local-variables-non-file-buffer) ; before sorting
   (dired-sort-other dired-actual-switches t)
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index fa22500a04e..af2658d60a3 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1283,6 +1294,36 @@ frameset-filter-tabs
 
 (push '(tabs . frameset-filter-tabs) frameset-filter-alist)
 
+(defun window-set-context-default-function (w)
+  "Set context to the front/rear strings."
+  (when buffer-file-name
+    (let ((point (window-point w)))
+      `((front-context-string
+         . ,(buffer-substring-no-properties
+             point (min (+ point 16) (point-max))))
+        (rear-context-string
+         . ,(buffer-substring-no-properties
+             point (max (- point 16) (point-min))))))))
+
+(defun window-use-context-default-function (w context)
+  "Restore context by the front/rear strings."
+  (let ((point (window-point w)))
+    (save-excursion
+      (goto-char point)
+      (when-let ((f (alist-get 'front-context-string context))
+                 ((search-forward f (point-max) t)))
+        (goto-char (match-beginning 0))
+        (when-let ((r (alist-get 'rear-context-string context))
+                   ((search-backward r (point-min) t)))
+          (goto-char (match-end 0))
+          (setq point (point)))))
+    (set-window-point w point)))
+
+(defvar window-set-context-function 'window-set-context-default-function)
+(defvar window-use-context-function 'window-use-context-default-function)
+
+(add-to-list 'window-persistent-parameters '(context . writable))
+
 (defun tab-bar--tab (&optional frame)
   "Make a new tab data structure that can be added to tabs on the FRAME."
   (let* ((tab (tab-bar--current-tab-find nil frame))
@@ -1292,6 +1333,15 @@ tab-bar--tab
                                            frame 'buffer-list)))
          (bbl (seq-filter #'buffer-live-p (frame-parameter
                                            frame 'buried-buffer-list))))
+    (when tab-bar-select-restore-context
+      (walk-windows
+       (lambda (w)
+         (with-current-buffer (window-buffer w)
+           (when-let (((functionp window-set-context-function))
+                      (context (funcall window-set-context-function w)))
+             (set-window-parameter w 'context (cons (buffer-name) context)))))
+       'nomini))
+
     `(tab
       (name . ,(if tab-explicit-name
                    (alist-get 'name tab)
@@ -1442,6 +1492,12 @@ tab-bar-select-restore-windows
           (setq buffer-read-only t)
           (set-window-buffer window new-buffer))))))
 
+(defcustom tab-bar-select-restore-context t
+  "Non-nil to restore context of the restored tab."
+  :type 'boolean
+  :group 'tab-bar
+  :version "30.1")
+
 (defvar tab-bar-minibuffer-restore-tab nil
   "Tab number for `tab-bar-minibuffer-restore-tab'.")
 
@@ -1539,6 +1595,17 @@ tab-bar-select-tab
             (select-window (get-mru-window)))
           (window-state-put ws nil 'safe)))
 
+        (when tab-bar-select-restore-context
+          (walk-windows
+           (lambda (w)
+             (with-current-buffer (window-buffer w)
+               (when-let (((functionp window-use-context-function))
+                          (context (window-parameter w 'context))
+                          ((equal (buffer-name) (car context))))
+                 (funcall window-use-context-function w (cdr context))
+                 (set-window-parameter w 'context nil))))
+           'nomini))
+
         ;; Select the minibuffer when it was active before switching tabs
         (when (and minibuffer-was-active (active-minibuffer-window))
           (select-window (active-minibuffer-window)))

--=-=-=--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 21 Mar 2024 09:22:02 +0000
Resent-Message-ID: <handler.33871.B33871.171101287128836 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171101287128836
          (code B ref 33871); Thu, 21 Mar 2024 09:22:02 +0000
Received: (at 33871) by debbugs.gnu.org; 21 Mar 2024 09:21:11 +0000
Received: from localhost ([127.0.0.1]:34643 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rnEbm-0007V0-LF
	for submit <at> debbugs.gnu.org; Thu, 21 Mar 2024 05:21:11 -0400
Received: from mout.gmx.net ([212.227.15.19]:45013)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1rnEbk-0007UW-KL
 for 33871 <at> debbugs.gnu.org; Thu, 21 Mar 2024 05:21:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1711012822; x=1711617622; i=rudalics@HIDDEN;
 bh=/sgaETDItmi9v7WRuyJB8aN29XXtHpcpMPDnlF+l40A=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:
 In-Reply-To;
 b=rORPksYKZeGtggIau/N5JHBtCJIfN/UVjVpO43a2GPydkyXs6Z6EJZazvjIkuXDb
 LEij+33wskpPj+EN6kRhauDXDzbdKENMZYOiuRiwYgwNTHJUDCEu6b3Mx/5duz60s
 Qwd1m+mAwyECbhMjG8pPMy1GkfM7ST6gm5kzTEQAiAN6Q2zWI2gupCgdeeMM27JGt
 Mk/WRKZhyi/Xm/jdJut1NXSah84VOAd+1yep+0d9ealWtYWu7lntnv4C5mcVtFAno
 SKRN7PQjcYhE3pH3FKOdKcIR8hdbE7jx0O3ZLaeiqwF2juGLiL8dzTXZMcKW+E2KA
 OZPvg1XxMrp1zXQP4A==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([212.95.5.196]) by mail.gmx.net (mrgmx004
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MYeQr-1rHUIf00tX-00VgLU; Thu, 21
 Mar 2024 10:20:22 +0100
Message-ID: <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
Date: Thu, 21 Mar 2024 10:20:21 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <87bm59mglk.fsf@HIDDEN> <86zgmsne32.fsf@HIDDEN>
 <a6971c90-bb5a-4492-395b-69f07925b2e7@HIDDEN>
 <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <8634skstio.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:7zUKcDCWq5Q8/Yef8lm3tUg1DCaYqFckbdFBq7P4tvoj8eLeOMT
 t9GGk20jBOS46NC9Oz4Cz5oR2G8uwRGSsfUmoFU6Txy4C1J0DlAcftvutE291IabKy/JhZQ
 ougltmEaEAzPRN0jV50ZvYbtSmy75zUt4Mq8oYAFu1Hj8LDuq5fezZZO6Bi/Yl1TstXxrPZ
 22OY8isHH+oA1UXuNEfHw==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:jBx0JhI8q9A=;r//jCgGrZBCzv0nTycwUVpokn6a
 5eFplnb3AkJtL0WK6y3QImHq++42WQiEmqPfrfH8H05NYj0rC1bcNpv9z5I/zy/xZtYTdp6gM
 clquk4bv18lZeZKNWyX5dh2fszA6NpHzE2rqVPhBq1W5jSZ5BfrB7n6YAO57uBM1uRbzzyZ37
 q98bty/X+sthbhxrJWJo64zATmuF3ARjQimq74053yz+bXxSym2BrVQgE5iwJA+qV37BEnFEh
 YiiTUzxzM20fDUOtaJzVkc6h3FbuLsxJIDifAIG2LrLexiN8SIWNAhnOue0Dr65tlRR4sZmtT
 UiJch3TkhRmHGWEycSmo0M5XFH0UWSPodrOEa8FF6w6/4eCZSLVLY3j2sRnTz/H57c3FlqDXI
 EopF+UteKpzZmm+stfVellg4vskK9OdkbV+D+oaO3bl9pU6NWOPpP7B9Fa4QEkOfDzVL44KF8
 MG/Xc7jYtsZA+apEhzMrtXMftJ5+Fy7VPndhQGwLD/z6HLPFjTcXTE+CIk2Uj0llukot21hwt
 AvtNy6J1Quc2QQPbYLzN4F/lTRk2Ank+Wyb3nVyI+S5KICsJAlVbNsuukB+3hSmZgtcg3jx/4
 jb1YwHtoaYiLqN/19dn7N0wFzA8Uj9shH2daLulXJhr4Mm7HtbDTJZpr1NiWSALxfLpdfVqj9
 tKyQmTSLhusq2ME+kGQToARt9EJn46V4yTBCh7p/ANrYF6QwrUyjDyo3MV/9Rn1hj8LKGNiqA
 IeftXGaIZRV5k7yb182FJZEC5KghCOZHuQy8imyRJFmzbpwG/Eu6WkrHa0ZApjfJWxszTEP0H
 sBdiSu2Fjp7AIGSjO4LlElMdRBAa2jFCD21Gp+JFFNmSY=
X-Spam-Score: 2.9 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: > Avoiding select-window removed simplicity and now requires
 > adding more handling and more testing. But finally > everything works
 correctly.
 Please review the new patch: Can you please provide me with a complete
 scenario
 the old code got wrong? I'm rather confused by the number of different bugs
 we've been trying to solve here. IIUC the original Bug#33871 is still uns
 [...] Content analysis details:   (2.9 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [212.95.5.196 listed in zen.spamhaus.org]
 0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [212.227.15.19 listed in wl.mailspike.net]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (rudalics[at]gmx.at)
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [212.227.15.19 listed in list.dnswl.org]
 0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.9 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > Avoiding select-window removed simplicity and now requires
    > adding more handling and more testing. But finally > everything works correctly.
    Please review the new patch: Can you please provide me with a complete scenario
    the old code got wrong? I'm rather confused by the number of different bugs
    we've been trying to solve here. IIUC the original Bug#33871 is still uns
    [...] 
 
 Content analysis details:   (1.9 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [212.227.15.19 listed in wl.mailspike.net]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [212.95.5.196 listed in zen.spamhaus.org]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
                             low trust
                             [212.227.15.19 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (rudalics[at]gmx.at)
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

 > Avoiding select-window removed simplicity and now requires
 > adding more handling and more testing.  But finally
 > everything works correctly.  Please review the new patch:

Can you please provide me with a complete scenario the old code got
wrong?  I'm rather confused by the number of different bugs we've been
trying to solve here.  IIUC the original Bug#33871 is still unsolved.
Bug#33532 as well.  What about Bug#68235 and Bug#69093?  And Bug#12253?

Thanks, martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 21 Mar 2024 18:03:02 +0000
Resent-Message-ID: <handler.33871.B33871.171104412717625 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171104412717625
          (code B ref 33871); Thu, 21 Mar 2024 18:03:02 +0000
Received: (at 33871) by debbugs.gnu.org; 21 Mar 2024 18:02:07 +0000
Received: from localhost ([127.0.0.1]:48894 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rnMjv-0004aC-FC
	for submit <at> debbugs.gnu.org; Thu, 21 Mar 2024 14:02:07 -0400
Received: from mslow1.mail.gandi.net ([217.70.178.240]:35223)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1rnMjs-0004Zx-Hf
 for 33871 <at> debbugs.gnu.org; Thu, 21 Mar 2024 14:02:05 -0400
Received: from relay6-d.mail.gandi.net (unknown [217.70.183.198])
 by mslow1.mail.gandi.net (Postfix) with ESMTP id 85A17C3D04
 for <33871 <at> debbugs.gnu.org>; Thu, 21 Mar 2024 18:00:05 +0000 (UTC)
Received: by mail.gandi.net (Postfix) with ESMTPSA id BB71FC0002;
 Thu, 21 Mar 2024 17:59:44 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN> (martin rudalics's
 message of "Thu, 21 Mar 2024 10:20:21 +0100")
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
Date: Thu, 21 Mar 2024 19:54:51 +0200
Message-ID: <86msqr79n8.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: 0.6 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.4 (/)

>> Avoiding select-window removed simplicity and now requires
>> adding more handling and more testing.  But finally
>> everything works correctly.  Please review the new patch:
>
> Can you please provide me with a complete scenario the old code got
> wrong?  I'm rather confused by the number of different bugs we've been
> trying to solve here.

There are two scenarios that this patch will fix:

1. switching tabs with the same reverted Dired buffer

For example,

a. create two windows with the same Dired buffer (e.g. split-window)
b. clone the tab with 'C-x t n'
c. revert Dired buffer with 'g'
d. switch back to the previous tab
e. observe that point in the non-selected Dired window
   relocates to the top of the buffer
f. in Emacs 30 point is relocated also in the selected window

2. second scenario for file buffers:

a. visit a file buffer
b. clone the tab with 'C-x t n'
c. edit the same file buffer before the previous point
d. save the desktop (that turns markers into integers)
e. restart Emacs and load the desktop
f. optionally edit the same buffer again
g. switch back to the previous tab
h. due to integer positions point is restored in a random place

The patch uses the context functions to restore the right position.

> IIUC the original Bug#33871 is still unsolved.

The proposed patch will close bug#33871.

> Bug#33532 as well.

Bug#33532 could be closed as well due to new context functions.

> What about Bug#68235 and Bug#69093?

Bug#68235 is closed, but the patch will solve the issue
mentioned in https://debbugs.gnu.org/68235#79
starting with the words:
"BTW, there is another problem when the same buffer is displayed
in two tabs/window-configurations."

Bug#69093 is completely fixed.

> And Bug#12253?

Bug#12253 is unrelated, but thanks for reminder,
it should be addressed later as well.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 22 Mar 2024 09:28:02 +0000
Resent-Message-ID: <handler.33871.B33871.171109963120549 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171109963120549
          (code B ref 33871); Fri, 22 Mar 2024 09:28:02 +0000
Received: (at 33871) by debbugs.gnu.org; 22 Mar 2024 09:27:11 +0000
Received: from localhost ([127.0.0.1]:36802 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rnbB8-0005LM-UU
	for submit <at> debbugs.gnu.org; Fri, 22 Mar 2024 05:27:11 -0400
Received: from mout.gmx.net ([212.227.15.19]:41801)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1rnbB5-0005Kv-OU
 for 33871 <at> debbugs.gnu.org; Fri, 22 Mar 2024 05:27:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1711099580; x=1711704380; i=rudalics@HIDDEN;
 bh=Wum+0dtCDD/Zg1er6kYexowm8QJEVDuPKxNQDpmU3Js=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:
 In-Reply-To;
 b=sNCTTpkSlBs5P20PUFxDWR/zZ2YrheOihuG3d1fv9AkylHkPnpLXrCZWY1wd8Qcf
 0FmVy7ltObGY7ruMfezc770I/Q6E4g0c/c+i2gh1sMya2tVmcadETsAeiXyuXe6Yh
 3Djz5lkexDZYSWajaVn7iVgvAu04DnkA9X+6yeMgLjdXE0Fe6aldYh9fTnLEWctX7
 rDlHv3LPAZk5fMKNuzf318rQFowJxdl9Ob2Nme6AMMxpKBkqaP5IseugOzVl17DyU
 2ljGeGnvlsAwrevIVMnc+8vWiQoiF/hhs9OkuL9DsdgDZCBwBO+b+Tb7nYEGbQ/Jg
 /93Q4vhsdsEx2zZC8w==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([213.142.96.98]) by mail.gmx.net (mrgmx004
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MMobO-1rUpKK2Bbo-00Invh; Fri, 22
 Mar 2024 10:26:20 +0100
Message-ID: <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
Date: Fri, 22 Mar 2024 10:26:19 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <87bm59mglk.fsf@HIDDEN> <86sfsi29yc.fsf@HIDDEN>
 <1830e7af-27a8-ac7f-ba6f-fa2006139208@HIDDEN>
 <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86msqr79n8.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:fCOFuur8KWOXdlW8ksIA4JSzDs7+YoQGUixhtf7OdyopRf0fpxD
 71ks/+zeUKtb7MohBfaV0FLMjq5rYBr/MiRY4GyCQxTZmcHSZVQurEoX3RDQ5AJMMEI5zcV
 meJin8GOvptQCaJfQBkqaeNn3Ez0ECaMVSoCMDwKr7ToLIL3YKPM/78cOW5Bp8drwiJu77Y
 faINDCTvA/IAzlz680iyA==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:pQqQosiCcFE=;JZNT1pMjVl0lByjtmj37sYySBI5
 Lz3a5h0zb/8k9V8u73b4wCQZna+qgxXoLmNVuPqaFa9ogFvj8WL+VJ0WwPtUe7LPxmfpgADcA
 BThxVA8nq39jS3VbEHAnCaFJXogHHCBWfPpyblQ6zy8D1QZnoT27x5M1GRN1QiJSEYVD4UyHn
 7D5v4IpsAoWE/D9JGUWCIKxQtKqVkQDFRIHbVFjT0jGM2S70Xa5yHVcXBrT+9iDB34iI2fpbI
 kZ58QC2+s6XdYSAAVwjUgLxnM58hp8/3BFYppGwbjU2AP9wss4ABXIrNanqs5GZdJQa4KXxET
 IOPaZ9JFwMsGtx9G3Oxx0okTrMsbpkp3dNBiFLqgN+6vyRzMNDSdgRgzBDYCcee0NOXEC4NbE
 DLFUJmlNP2N2mf93bKs/wB7F8v93WlTHIHWy+Sdii5//EtiYk7UbF93XNp7fh7cVTtBjs/6mY
 zOO0sY1qVK43o2Q2NLnqs/vkF//j8ZLjmzu1pGjrZTxhltKmln/SQ26rBhBhIkHQ8TMhvbIA/
 TDcNya21BGGYVUaNKgeDDUJPEsWs0fA3HN5TgcG7jed3N9y27EkkYqnuVJ7HkM6D8ZdB3FhsP
 SIvkJj/hpnOnqzx0Vh5HwfqjPpIucFZiCZbSugImxZvEJ1xJxvUA5kN/RWCeeQU+iJgEuAUXX
 fkgNE+fARXbJayEHeZmAS+ZKVdXvJS7lmkz5kz+sOQvqwUSTX4q94DH9wTZLg87YkmzLixRJA
 QUjrpzWDXh8AbSOrviUVQo/e53/U8cQRorTgH5bvww3VAVmu89JhQ+fklDQfIKuwQ0FtjYyKj
 gwM2ZUZxrEjbjnuIcVW1cF4V5Q+RR8XRAa8djExAJiWMBfFv55o7ZtVGtZBZ7dHkXl
X-Spam-Score: 2.9 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: > There are two scenarios that this patch will fix: I
 reconstructed
 the buggy behaviors and checked that the patch fixes them. >> IIUC the
 original
 Bug#33871 is still unsolved. > > The proposed patch will close bug#33871.
 Content analysis details:   (2.9 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [212.227.15.19 listed in list.dnswl.org]
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [213.142.96.98 listed in zen.spamhaus.org]
 0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [212.227.15.19 listed in wl.mailspike.net]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (rudalics[at]gmx.at)
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.9 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > There are two scenarios that this patch will fix: I reconstructed
    the buggy behaviors and checked that the patch fixes them. >> IIUC the original
    Bug#33871 is still unsolved. > > The proposed patch will close bug#33871.
    
 
 Content analysis details:   (1.9 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [212.227.15.19 listed in wl.mailspike.net]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [213.142.96.98 listed in zen.spamhaus.org]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
                             low trust
                             [212.227.15.19 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (rudalics[at]gmx.at)
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

 > There are two scenarios that this patch will fix:

I reconstructed the buggy behaviors and checked that the patch fixes
them.

 >> IIUC the original Bug#33871 is still unsolved.
 >
 > The proposed patch will close bug#33871.

Can you amend the original scenario you posted there in a way that one
can see how your patch can be used to fix it. That's where I stumbled
initially because I didn't know what to do.

 >> Bug#33532 as well.
 >
 > Bug#33532 could be closed as well due to new context functions.
 >
 >> What about Bug#68235 and Bug#69093?
 >
 > Bug#68235 is closed, but the patch will solve the issue
 > mentioned in https://debbugs.gnu.org/68235#79
 > starting with the words:
 > "BTW, there is another problem when the same buffer is displayed
 > in two tabs/window-configurations."
 >
 > Bug#69093 is completely fixed.

Is there any place where we should amend the documentation for these?
Which are the cases where the context function will fail to work?

 >> And Bug#12253?
 >
 > Bug#12253 is unrelated, but thanks for reminder,
 > it should be addressed later as well.

If there's anything I can or should do, please tell me.

Thanks, martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 22 Mar 2024 16:20:01 +0000
Resent-Message-ID: <handler.33871.B33871.171112434929821 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171112434929821
          (code B ref 33871); Fri, 22 Mar 2024 16:20:01 +0000
Received: (at 33871) by debbugs.gnu.org; 22 Mar 2024 16:19:09 +0000
Received: from localhost ([127.0.0.1]:34472 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rnhbp-0007ku-0U
	for submit <at> debbugs.gnu.org; Fri, 22 Mar 2024 12:19:09 -0400
Received: from relay4-d.mail.gandi.net ([217.70.183.196]:35123)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1rnhbm-0007k1-I6
 for 33871 <at> debbugs.gnu.org; Fri, 22 Mar 2024 12:19:07 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 322E1E0002;
 Fri, 22 Mar 2024 16:17:58 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN> (martin rudalics's
 message of "Fri, 22 Mar 2024 10:26:19 +0100")
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
Date: Fri, 22 Mar 2024 18:15:52 +0200
Message-ID: <86zfuq5jxj.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain

>> There are two scenarios that this patch will fix:
>
> I reconstructed the buggy behaviors and checked that the patch fixes
> them.

Thanks for confirming.

>>> IIUC the original Bug#33871 is still unsolved.
>>
>> The proposed patch will close bug#33871.
>
> Can you amend the original scenario you posted there in a way that one
> can see how your patch can be used to fix it. That's where I stumbled
> initially because I didn't know what to do.

The original scenario was:

(progn (dired "/tmp") (dired-next-line 1)
       (split-window) (other-window 1)
       (dired "/tmp") (dired-next-line 2)
       (let ((w-c (current-window-configuration))
	     (p-m (point-marker)))
	 (view-emacs-todo) (delete-other-windows)
	 (with-current-buffer (get-buffer "tmp")
	   (revert-buffer))
	 (set-window-configuration w-c)
	 (goto-char p-m)))

Ok, let's add new code to separate functions
'window-set-context' and 'window-use-context'.
Below is the patch with these new functions.
Maybe they could be moved from tab-bar.el to window.el?

Then the amended scenario will be:

(progn (dired "/tmp") (dired-next-line 1)
       (split-window) (other-window 1)
       (dired "/tmp") (dired-next-line 2)
       (window-set-context)
       (let ((w-c (current-window-configuration))
	     (p-m (point-marker)))
	 (view-emacs-todo) (delete-other-windows)
	 (with-current-buffer (get-buffer "tmp")
	   (revert-buffer))
	 (set-window-configuration w-c)
	 (window-use-context)))

>>> Bug#33532 as well.
>>
>> Bug#33532 could be closed as well due to new context functions.
>>
>>> What about Bug#68235 and Bug#69093?
>>
>> Bug#68235 is closed, but the patch will solve the issue
>> mentioned in https://debbugs.gnu.org/68235#79
>> starting with the words:
>> "BTW, there is another problem when the same buffer is displayed
>> in two tabs/window-configurations."
>>
>> Bug#69093 is completely fixed.
>
> Is there any place where we should amend the documentation for these?

If code is ok, I could update the documentation.

> Which are the cases where the context function will fail to work?

I'm not aware of any such cases.


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=tab-bar-select-restore-context-2.patch

diff --git a/lisp/dired.el b/lisp/dired.el
index 9e3b888df14..cb2fc97d0ae 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2743,6 +2745,24 @@ dired-mode
               '(dired-font-lock-keywords t nil nil beginning-of-line))
   (setq-local desktop-save-buffer 'dired-desktop-buffer-misc-data)
   (setq-local grep-read-files-function #'dired-grep-read-files)
+  (setq-local window-set-context-function
+              (lambda (w)
+                (let ((point (window-point w)))
+                  (save-excursion
+                    (goto-char point)
+                    (if-let ((f (dired-get-filename nil t)))
+                        `((dired-filename . ,f))
+                      `((position . ,(point))))))))
+  (setq-local window-use-context-function
+              (lambda (w context)
+                (let ((point (window-point w)))
+                  (save-excursion
+                    (if-let ((f (alist-get 'dired-filename context)))
+                        (dired-goto-file f)
+                      (when-let ((p (alist-get 'position context)))
+                        (goto-char p)))
+                    (setq point (point)))
+                  (set-window-point w point))))
   (setq dired-switches-alist nil)
   (hack-dir-local-variables-non-file-buffer) ; before sorting
   (dired-sort-other dired-actual-switches t)
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index fa22500a04e..528c85f45d6 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1283,6 +1283,58 @@ frameset-filter-tabs
 
 (push '(tabs . frameset-filter-tabs) frameset-filter-alist)
 
+(defun window-set-context-default-function (w)
+  "Set context to the front/rear strings."
+  (when buffer-file-name
+    (let ((point (window-point w)))
+      `((front-context-string
+         . ,(buffer-substring-no-properties
+             point (min (+ point 16) (point-max))))
+        (rear-context-string
+         . ,(buffer-substring-no-properties
+             point (max (- point 16) (point-min))))))))
+
+(defun window-use-context-default-function (w context)
+  "Restore context by the front/rear strings."
+  (let ((point (window-point w)))
+    (save-excursion
+      (goto-char point)
+      (when-let ((f (alist-get 'front-context-string context))
+                 ((search-forward f (point-max) t)))
+        (goto-char (match-beginning 0))
+        (when-let ((r (alist-get 'rear-context-string context))
+                   ((search-backward r (point-min) t)))
+          (goto-char (match-end 0))
+          (unless (eq point (point))
+            (warn "!!! %S -> %S r=%S f=%S" point (point) r f))
+          (setq point (point)))))
+    (set-window-point w point)))
+
+(defvar window-set-context-function 'window-set-context-default-function)
+(defvar window-use-context-function 'window-use-context-default-function)
+
+(add-to-list 'window-persistent-parameters '(context . writable))
+
+(defun window-set-context ()
+  (walk-windows
+   (lambda (w)
+     (with-current-buffer (window-buffer w)
+       (when-let (((functionp window-set-context-function))
+                  (context (funcall window-set-context-function w)))
+         (set-window-parameter w 'context (cons (buffer-name) context)))))
+   'nomini))
+
+(defun window-use-context ()
+  (walk-windows
+   (lambda (w)
+     (with-current-buffer (window-buffer w)
+       (when-let (((functionp window-use-context-function))
+                  (context (window-parameter w 'context))
+                  ((equal (buffer-name) (car context))))
+         (funcall window-use-context-function w (cdr context))
+         (set-window-parameter w 'context nil))))
+   'nomini))
+
 (defun tab-bar--tab (&optional frame)
   "Make a new tab data structure that can be added to tabs on the FRAME."
   (let* ((tab (tab-bar--current-tab-find nil frame))
@@ -1292,6 +1344,9 @@ tab-bar--tab
                                            frame 'buffer-list)))
          (bbl (seq-filter #'buffer-live-p (frame-parameter
                                            frame 'buried-buffer-list))))
+    (when tab-bar-select-restore-context
+      (window-set-context))
+
     `(tab
       (name . ,(if tab-explicit-name
                    (alist-get 'name tab)
@@ -1442,6 +1497,12 @@ tab-bar-select-restore-windows
           (setq buffer-read-only t)
           (set-window-buffer window new-buffer))))))
 
+(defcustom tab-bar-select-restore-context t
+  "Non-nil to restore context of the restored tab."
+  :type 'boolean
+  :group 'tab-bar
+  :version "30.1")
+
 (defvar tab-bar-minibuffer-restore-tab nil
   "Tab number for `tab-bar-minibuffer-restore-tab'.")
 
@@ -1539,6 +1600,9 @@ tab-bar-select-tab
             (select-window (get-mru-window)))
           (window-state-put ws nil 'safe)))
 
+        (when tab-bar-select-restore-context
+          (window-use-context))
+
         ;; Select the minibuffer when it was active before switching tabs
         (when (and minibuffer-was-active (active-minibuffer-window))
           (select-window (active-minibuffer-window)))

--=-=-=--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 23 Mar 2024 09:21:02 +0000
Resent-Message-ID: <handler.33871.B33871.171118561930056 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171118561930056
          (code B ref 33871); Sat, 23 Mar 2024 09:21:02 +0000
Received: (at 33871) by debbugs.gnu.org; 23 Mar 2024 09:20:19 +0000
Received: from localhost ([127.0.0.1]:39770 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rnxY2-0007oi-SF
	for submit <at> debbugs.gnu.org; Sat, 23 Mar 2024 05:20:19 -0400
Received: from mout.gmx.net ([212.227.17.20]:36841)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1rnxXz-0007o8-Gl
 for 33871 <at> debbugs.gnu.org; Sat, 23 Mar 2024 05:20:17 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1711185568; x=1711790368; i=rudalics@HIDDEN;
 bh=qS71Mg+ZLh+wximksB2d2kVEMxxpqb0Vwqg8Sbinrek=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:
 In-Reply-To;
 b=d+7e37k5oQy6DFUIq2i4thC3Bi8JJIRwd6QLE9wZeL4DpP43PHZfDaQZPy8N33ah
 95HuJK3YNDLdM2pWoCo1xsM5hElrWSAX7hGEsLCz+lruvWGeq1I1reQ9smezU88zi
 LT6wuWGabEkk0YxUU61sq6APYKS0fEiL/YPrNU10lToS5syZmyU76PRs3UFiPkQ1P
 FLUPxy1+EOtalJ3gSeO22LT2tNpfg6H10lhBBZiJIgjDl4YI9OxyFkWC/WnnHxXs5
 R0Yo85WwTpxTRp4XMvHd9smE50ojQXzDTfoMI196Ig3/8CtOXE6jler+8DWWyYH3v
 jjS/0Cs8o5gCH5e7Bg==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([213.142.97.11]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MsHru-1quKvw3Edu-00tmZN; Sat, 23
 Mar 2024 10:14:26 +0100
Message-ID: <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN>
Date: Sat, 23 Mar 2024 10:14:25 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <87bm59mglk.fsf@HIDDEN> <86fsohmqn9.fsf@HIDDEN>
 <9df28298-fedc-0cfe-7243-c04868115e90@HIDDEN>
 <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
 <86zfuq5jxj.fsf@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86zfuq5jxj.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:/eX/VcJLCBytxFz3IMTl9Fwq92kioKr8qEsml6USqqWOwrkALgK
 wVoXzPKPGR0DVHgDaGAlh1w3B5Gm51iOOgTxnRzzPk8xzdyIPdcmXz5TNaQ4DrzWNyWSU12
 V3kAGV/gmR9VWebB/0aLVplzQlbeLXd9q7IgtIomNIIuFAWONGu1lHIbiS0LjU4wAFL1Em+
 XVozsPE8aFeOO+jblXoUQ==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:pqKxcN+KBIw=;Eb+gly3V++Lx10SQYstClpim9KH
 af5sjXiKgxt1V4qo3jJmOVMkfdFXTt2a797bn8d5swxaaNpVudawMDTm5JaR/M6+U0qvT8YgB
 IR37gWUPPIADf9RdjCLa33ds3yDXf3JwUbQ6mMD1KxCR3ng9IQzNUmRyK3X8TwdjGaEXoRUMA
 cN//2HZ+aR7JJiAZxo1ox7yEEyC+cSZL3ZCt437XCYPR14Bda8IE6tG3vVGO6nJF23t1R6F4u
 i6oT9zxikZBUEpcfmO8enuOAYIQxE1AMKSfhxAXXYEZJ/vfZo8msBS95nhuE6ECVX+58QP7lH
 znurrgUmhRxzOVZ8JrrdLifSLvsqSGRUCMeTqxB8NSvjAOZGCEXQN+vXTpC17Pwi4Jac7T7oo
 IGscsFwJ9oi6aJ0R9Do9nYSgX+0JAmXRASPjOvyM0I82uqfcXDi+zZqCTF+qC3t8h4vrFyi53
 Ah5WyntUKVn/JEOiKGakgDbt6br5d5JYMQsi2ydxIT5RudDvKV3cwlfwPvMfY1EeUAXN2RPi/
 xKD3FMWUaZ5EOba3yXN63Ty+sOtBkC1XBq3kqaUH7VYNz08mnWoiXm8HOpzOkF+x0swOPsefW
 6cVvu9zH3PirorPbldkpdPqcwPvavBOKXfhifU2KbRc7GIKjnGOWbQ8dJ91vzq0DHGhYC6g0h
 gjzh8ZUrDQW95eYWDoonc1l3Y9YtSEwITRvlPz2iCnF/q3ovDXuvE0lWaB7rFh8NW00SgZ6Ek
 3M+bCJLaMxxEvHguYhLB6V6yJRyffxx7ymQzgKhHKLMCdbbncqfxKoJGsW2Bra0eqWhNAuEVt
 NBAPakUsTwUk6br4NX7fHLQX+3Z9uLyUlxIRg9FWHjVqg=
X-Spam-Score: 2.9 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  > Ok,
 let's add new code to separate functions > 'window-set-context'
 and 'window-use-context'. > Below is the patch with these new functions.
 > Maybe they could be moved from tab-bar.el to window.el [...] 
 Content analysis details:   (2.9 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [213.142.97.11 listed in zen.spamhaus.org]
 0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [212.227.17.20 listed in wl.mailspike.net]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (rudalics[at]gmx.at)
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [212.227.17.20 listed in list.dnswl.org]
 0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.9 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > Ok, let's add new code to separate functions > 'window-set-context'
    and 'window-use-context'. > Below is the patch with these new functions.
   > Maybe they could be moved from tab-bar.el to window.el [...] 
 
 Content analysis details:   (1.9 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [212.227.17.20 listed in wl.mailspike.net]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [213.142.97.11 listed in zen.spamhaus.org]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
                             low trust
                             [212.227.17.20 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (rudalics[at]gmx.at)
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

 > Ok, let's add new code to separate functions
 > 'window-set-context' and 'window-use-context'.
 > Below is the patch with these new functions.
 > Maybe they could be moved from tab-bar.el to window.el?

I think you should do that.  Maybe 'window-restore-set-context' and
'window-restore-use-context' would be more indicative names.

Note that when a buffer is killed, the values of its local variables may
be lost.  I don't know whether this is an issue here.  Alternatively, we
could have 'set_window_buffer' set the 'context' window parameter from
the buffer-local value which would, however, mean that whenever one
changes the buffer-local value, one would have to simultaneously update
the parameters in all windows showing that buffer.  Something that could
be done with the help of an advice, though...

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 23 Mar 2024 18:42:01 +0000
Resent-Message-ID: <handler.33871.B33871.171121927422996 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171121927422996
          (code B ref 33871); Sat, 23 Mar 2024 18:42:01 +0000
Received: (at 33871) by debbugs.gnu.org; 23 Mar 2024 18:41:14 +0000
Received: from localhost ([127.0.0.1]:46493 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ro6Io-0005yd-Db
	for submit <at> debbugs.gnu.org; Sat, 23 Mar 2024 14:41:14 -0400
Received: from mslow1.mail.gandi.net ([217.70.178.240]:37059)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1ro6Im-0005yN-0Z
 for 33871 <at> debbugs.gnu.org; Sat, 23 Mar 2024 14:41:09 -0400
Received: from relay7-d.mail.gandi.net (unknown [217.70.183.200])
 by mslow1.mail.gandi.net (Postfix) with ESMTP id 79C50C2C41
 for <33871 <at> debbugs.gnu.org>; Sat, 23 Mar 2024 18:34:58 +0000 (UTC)
Received: by mail.gandi.net (Postfix) with ESMTPSA id 81A9F20002;
 Sat, 23 Mar 2024 18:34:37 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN> (martin rudalics's
 message of "Sat, 23 Mar 2024 10:14:25 +0100")
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
 <86zfuq5jxj.fsf@HIDDEN>
 <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN>
Date: Sat, 23 Mar 2024 20:31:57 +0200
Message-ID: <86plvksv1e.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: 0.6 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.4 (/)

>> Ok, let's add new code to separate functions
>> 'window-set-context' and 'window-use-context'.
>> Below is the patch with these new functions.
>> Maybe they could be moved from tab-bar.el to window.el?
>
> I think you should do that.

OTOH, tab-bar.el is preloaded as well, so no problem to leave this
in tab-bar.el, since window.el is too large already.

> Maybe 'window-restore-set-context' and 'window-restore-use-context'
> would be more indicative names.

The name 'window-restore-set-context' looks quite self-contradictory.
If your intention was to use a unique prefix, then maybe we could use the
prefix 'window-context' like in 'window-context-set', 'window-context-use'.

> Note that when a buffer is killed, the values of its local variables may
> be lost.  I don't know whether this is an issue here.  Alternatively, we
> could have 'set_window_buffer' set the 'context' window parameter from
> the buffer-local value which would, however, mean that whenever one
> changes the buffer-local value, one would have to simultaneously update
> the parameters in all windows showing that buffer.  Something that could
> be done with the help of an advice, though...

This doesn't look like an issue here because the context is stored
in a window parameter.  And when the buffer is killed, there is no need
to restore a context in the killed buffer.

The format of the window parameter

  '(BUFFER-NAME . ((dired-filename . FILENAME)))

uses BUFFER-NAME to check whether the buffer was killed,
and when the current window's buffer doesn't match BUFFER-NAME,
then do nothing.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 24 Mar 2024 09:56:01 +0000
Resent-Message-ID: <handler.33871.B33871.171127411225263 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171127411225263
          (code B ref 33871); Sun, 24 Mar 2024 09:56:01 +0000
Received: (at 33871) by debbugs.gnu.org; 24 Mar 2024 09:55:12 +0000
Received: from localhost ([127.0.0.1]:45130 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1roKZL-0006ZM-DV
	for submit <at> debbugs.gnu.org; Sun, 24 Mar 2024 05:55:11 -0400
Received: from mout.gmx.net ([212.227.17.21]:53861)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1roKZB-0006YH-OM
 for 33871 <at> debbugs.gnu.org; Sun, 24 Mar 2024 05:55:11 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1711274052; x=1711878852; i=rudalics@HIDDEN;
 bh=1YJMAdGv05cOThbYqP5FpYCsWctqHQpUAOHdl8tMaA4=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:
 In-Reply-To;
 b=lT+xkrohHlyHp0SbJqLHhhiMvDz4SLlxcnx6j87be+yhSMzz7JPj7gl8Hl8JmKfF
 jkzxkkrxEA10QMRGA6QpXHffC73bzGUhDQi7yBzZmGQVYnAWw/kr1KzFcCEx1pYSg
 WjO5fZsG1TONVfHl5utNJOuOG5XyGPKyPAR5miB10/0FX4sIythM4U+8nKk9rqpNC
 8Cubr39s9tBCY1je6wBdyq7qT3nQnEhUcV9+C5ZZvoXlNuwcQ6BkmEaZonRZxZpY2
 YrkNEE/JclxQN3xwNVPcf3ev8GrViD3eii0jQvmNM4GvxdhFFbJKK7tEOKvYo9Byz
 9mmJfWLADUgDwPjuRA==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([46.125.249.63]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MEUz4-1rYK8U2Ris-00Fzcc; Sun, 24
 Mar 2024 10:54:12 +0100
Message-ID: <578de52d-364b-4961-b4e2-7f91cdcaa0b9@HIDDEN>
Date: Sun, 24 Mar 2024 10:54:11 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <87bm59mglk.fsf@HIDDEN> <86fsoezsw3.fsf@HIDDEN>
 <ef43cbf4-7a55-8252-045c-c284a095d3d8@HIDDEN>
 <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
 <86zfuq5jxj.fsf@HIDDEN>
 <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN>
 <86plvksv1e.fsf@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86plvksv1e.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:IjaIYYlSdnQ4MLW/ysHxEbh5wHJD5xA0WjR5eU2GNsBzm1YMAg6
 ke69i7odN1iY5rgnTcHkAJ/MhhY8bP08UL+gz/ZYOQ+0mWe0X1ypSwhrfMEdm+bTzUAmRSI
 GzAapdmL8jXESXdjr3woJkWRVQtV/pK8JW6WABfuBW/rQNgYGkG61roUv9/AQTQ91cOniv6
 qNsF/Cv6GcHleW2fWC/GA==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:rBHHV8ZWuJ0=;zwx+ow9aF52aHpnOLu+KClhyCtc
 GEGGGvFNXl04FSUx9jOLrclPdNckeIKJFwD3JN61HN83OLiQoVrLcpIfnj44wzlVYhVAwp3Au
 dr/Dj7wXBnwcxNliwaS50LqEh2Z513nH0ute8hi6AiNzfx2VyINaN4NlBUtq2fC5SCwSAdJBx
 JgQltlMq9JVW+3KDqJZpMOpy3ScYZh8io0QafIjSwO1Y8Po8JaYGHO5nBxK901Y6hAMZOCF14
 2s7Yg0IjoZN/cWWkfFuVuUX/JT3XB/UvewEzlGc7rgTY22iSsgmXTLMG9n6EqNfy1/+o1xw8K
 tivTNQqU0SN7yKD8sTmIO57MFyV3C3FD/ZLeAjYG8c7vsbnjNzU6bIXCa2ekzEm9rKUsi7hdk
 8MBQoYhyyJ+HcoXXdQ7fkuZ3mhMrIw4zWeSK3BD9/C4QSK+zrEwRmS3sS5lO2wJGnle0nU21D
 /E1zGd9YXeAvsQHRTmH23A56dWpADs0iQCQTtCiy6fplpRBKSzXAiyG3oCjFe904r6DIDthB1
 eG6LNIgM0J+yEpC3OPpD0AD9fP6Fft27aajS6caEc9CGw3mpjfpmdp4jRsb9uCajZYJ3HIObL
 R6wZ1778Eovj184ArN0o6pNuWrFxjwtL0aIIY//PSIuZjAWIFatkrm1FQ/otttSO8BdRqCxCx
 KEjFwIRDhsuRbJ1T6G8QT6hZ3/4gPdgn/gbUl8ayIS0Q1oYbXlK3gQ6AK6oLMlkFz8esFLhqY
 zEmvmmg29H7NsJf6OF6ufumGmdOQufm0a0KcnKWv4Mn9tziS0LLsyBlEadzBgNY3mJ0xEqJBu
 i0crvrDOC7wPkNZTv8Dh7TVgtMXpa7AdgIO33344WQrQA=
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.9 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > OTOH, tab-bar.el is preloaded as well, so no problem to
    leave this > in tab-bar.el, since window.el is too large already. Then I
   would give them a 'tab-bar-' prefix. >> Maybe 'window-restore-set-context'
    and 'window-restore-use-context' >> would be more indicative names. > > The
    name 'window-restore-set-context' looks quite self-contradictory. > If your
    intention [...] 
 
 Content analysis details:   (1.9 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [212.227.17.21 listed in wl.mailspike.net]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [46.125.249.63 listed in zen.spamhaus.org]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
                             low trust
                             [212.227.17.21 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (rudalics[at]gmx.at)
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

 > OTOH, tab-bar.el is preloaded as well, so no problem to leave this
 > in tab-bar.el, since window.el is too large already.

Then I would give them a 'tab-bar-' prefix.

 >> Maybe 'window-restore-set-context' and 'window-restore-use-context'
 >> would be more indicative names.
 >
 > The name 'window-restore-set-context' looks quite self-contradictory.
 > If your intention was to use a unique prefix, then maybe we could use the
 > prefix 'window-context' like in 'window-context-set', 'window-context-use'.

I'd say the context of a window are the other windows of the same frame.

 >> Note that when a buffer is killed, the values of its local variables may
 >> be lost.  I don't know whether this is an issue here.  Alternatively, we
 >> could have 'set_window_buffer' set the 'context' window parameter from
 >> the buffer-local value which would, however, mean that whenever one
 >> changes the buffer-local value, one would have to simultaneously update
 >> the parameters in all windows showing that buffer.  Something that could
 >> be done with the help of an advice, though...
 >
 > This doesn't look like an issue here because the context is stored
 > in a window parameter.

IIUC the context is stored but not the function to restore the position
from the context.

 > And when the buffer is killed, there is no need
 > to restore a context in the killed buffer.

If you don't intend to restore the context from the file the buffer was
visiting.  Are you sure you don't want to do that?

 > The format of the window parameter
 >
 >    '(BUFFER-NAME . ((dired-filename . FILENAME)))
 >
 > uses BUFFER-NAME to check whether the buffer was killed,
 > and when the current window's buffer doesn't match BUFFER-NAME,
 > then do nothing.

What do you do when you want to restore a configuration from a tab, that
configuration contains a window whose buffer was killed but whose file
still exists and you wanted to revisit that file in the window with its
previous point?  Ignore any context for that window?

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 24 Mar 2024 17:22:02 +0000
Resent-Message-ID: <handler.33871.B33871.171130089318727 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171130089318727
          (code B ref 33871); Sun, 24 Mar 2024 17:22:02 +0000
Received: (at 33871) by debbugs.gnu.org; 24 Mar 2024 17:21:33 +0000
Received: from localhost ([127.0.0.1]:45352 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1roRXI-0004ry-L8
	for submit <at> debbugs.gnu.org; Sun, 24 Mar 2024 13:21:33 -0400
Received: from relay3-d.mail.gandi.net ([217.70.183.195]:43785)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1roRXF-0004rJ-Lu
 for 33871 <at> debbugs.gnu.org; Sun, 24 Mar 2024 13:21:30 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id C3FEE60004;
 Sun, 24 Mar 2024 17:20:40 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <578de52d-364b-4961-b4e2-7f91cdcaa0b9@HIDDEN> (martin rudalics's
 message of "Sun, 24 Mar 2024 10:54:11 +0100")
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
 <86zfuq5jxj.fsf@HIDDEN>
 <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN>
 <86plvksv1e.fsf@HIDDEN>
 <578de52d-364b-4961-b4e2-7f91cdcaa0b9@HIDDEN>
Date: Sun, 24 Mar 2024 19:12:53 +0200
Message-ID: <86frwf8w4q.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> OTOH, tab-bar.el is preloaded as well, so no problem to leave this
>> in tab-bar.el, since window.el is too large already.
>
> Then I would give them a 'tab-bar-' prefix.

I agree that if they remain in tab-bar.el they should have a 'tab-bar-' prefix.
But OTOH, such prefix doesn't look right to use for hooks in dired-mode,
because this is a general window functionality, not directly related to tabs.

Maybe still would be better to add this to window.el?
Then to not change the size of window.el, we could remove
some existing lines that don't belong to window.el.
For example, these defcustoms have no place in window.el:

  (defcustom display-comint-buffer-action
  (defcustom display-tex-shell-buffer-action

Ok, I will create a separate bug report to remove them.

>>> Maybe 'window-restore-set-context' and 'window-restore-use-context'
>>> would be more indicative names.
>>
>> The name 'window-restore-set-context' looks quite self-contradictory.
>> If your intention was to use a unique prefix, then maybe we could use the
>> prefix 'window-context' like in 'window-context-set', 'window-context-use'.
>
> I'd say the context of a window are the other windows of the same frame.

This was meant to denote a context inside a window.
Then maybe a better prefix would be 'window-point-context'?

>>> Note that when a buffer is killed, the values of its local variables may
>>> be lost.  I don't know whether this is an issue here.  Alternatively, we
>>> could have 'set_window_buffer' set the 'context' window parameter from
>>> the buffer-local value which would, however, mean that whenever one
>>> changes the buffer-local value, one would have to simultaneously update
>>> the parameters in all windows showing that buffer.  Something that could
>>> be done with the help of an advice, though...
>>
>> This doesn't look like an issue here because the context is stored
>> in a window parameter.
>
> IIUC the context is stored but not the function to restore the position
> from the context.

Indeed, there was an idea to store a function that restores point, but
this might be problematic when saving such a function to the desktop file.
Therefore, the patch has two separate functions to save and restore context
as mere strings and numbers.

>> And when the buffer is killed, there is no need
>> to restore a context in the killed buffer.
>
> If you don't intend to restore the context from the file the buffer was
> visiting.  Are you sure you don't want to do that?

After the buffer was killed?  This doesn't seems necessary.

>> The format of the window parameter
>>
>>    '(BUFFER-NAME . ((dired-filename . FILENAME)))
>>
>> uses BUFFER-NAME to check whether the buffer was killed,
>> and when the current window's buffer doesn't match BUFFER-NAME,
>> then do nothing.
>
> What do you do when you want to restore a configuration from a tab, that
> configuration contains a window whose buffer was killed but whose file
> still exists and you wanted to revisit that file in the window with its
> previous point?  Ignore any context for that window?

I think such cases are very rare.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 25 Mar 2024 15:59:02 +0000
Resent-Message-ID: <handler.33871.B33871.171138232314213 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171138232314213
          (code B ref 33871); Mon, 25 Mar 2024 15:59:02 +0000
Received: (at 33871) by debbugs.gnu.org; 25 Mar 2024 15:58:43 +0000
Received: from localhost ([127.0.0.1]:35762 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1romih-0003hB-85
	for submit <at> debbugs.gnu.org; Mon, 25 Mar 2024 11:58:43 -0400
Received: from mout.gmx.net ([212.227.17.20]:57257)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1romif-0003gx-Cf
 for 33871 <at> debbugs.gnu.org; Mon, 25 Mar 2024 11:58:42 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1711382316; x=1711987116; i=rudalics@HIDDEN;
 bh=ZRFgNBWq8Qk3xzMkT21ss6vnC88FOB50NvD/aq5Twp4=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:
 In-Reply-To;
 b=h/rNrxT9D2T5477JXilvn66yba4lqH1mnhHEdnoqXOdhbu3Tl8xgij3I0008AAZA
 RV4W5oIrOaYZvypKKrJx5JbIvPLEp4vjEUANbJ4OgaaJHMdhnR6K14yZ4b44b0eRO
 1hJ3j1AlTq7LSMPt29k1nQd9jkRWS8cm+dOju3qxVBIcWf3cmCIS5cJC8ksYlSEqm
 34mGvSi2Poczr7MZbkRRK+pPmFky1nkTymdcO6ydgdmciJMpRJM7HyzQWxo9yOkLl
 O6FhTbCHRXfOd/Ofm6p/rFfY5KSoK1I7TObmQoIKvBcChleqzl0yuJLFJGztvEHcL
 8aB96+0fA2Sq02f+qA==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([212.95.5.240]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mr9G2-1scv0F32aE-00oEE9; Mon, 25
 Mar 2024 10:41:09 +0100
Message-ID: <128b074a-b766-47eb-92ff-79814c900a06@HIDDEN>
Date: Mon, 25 Mar 2024 10:41:08 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <87bm59mglk.fsf@HIDDEN> <86sfsewvxr.fsf@HIDDEN>
 <9d741b43-e3bb-669b-b345-6b877c902b33@HIDDEN>
 <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
 <86zfuq5jxj.fsf@HIDDEN>
 <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN>
 <86plvksv1e.fsf@HIDDEN>
 <578de52d-364b-4961-b4e2-7f91cdcaa0b9@HIDDEN>
 <86frwf8w4q.fsf@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86frwf8w4q.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:tX3gT63GbmqK1zn/TAZ7i/0of6458QsDQGxBDBnB1ZuuG+Ym4+v
 W2PQW7WfQtjmuSlUT3cqHswvDYdNSfLnnU5iMz+PvyUYSyotuApXU1XqNM4fcZGIW1VNgiG
 MEJOTeYmyDFsglBPtrN5QfxpOpEMcp9d3M9xyJOU0zhuKgAYMS/OQo33QKNkGiCNSXUZ0on
 Ceh2bmmzADzGVuLEvKcbQ==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:AP/tUEdbAuk=;HvSq8K1kOkiwN6rArGIpya2imks
 /8cQyrLJ9Uv8j1RC9zMcpXc3HS19/Y8JY4EtoArSh4WfMp/UBKXmLqUFPQQOSZl0YeSYGgWbt
 aftrK7W/G/E0Os2KbotgR/lsDILgoLJ9DtXn0leCz92ocWHB+gUjUKS1/fswLFbAYIH1Avj8P
 xxhS02eZdq7JxymHvZ6NYYQ1Rp8+Wb/XAQK+472wfdPHVga/AT4roRTlg+zIeA7BJO/+kdpty
 T9ciW5uloYCBdiXca8RwqJR60+GHS2DSMbZFL5To8dfaQqLoQiHIYDcTutM1yS+uoYaQf8B7w
 jLLGuW5P0ZS067IZddfAscIRe5rxo8AgWvmRqXu/iaymmySe5IJ0w20yLlVMg82w91baOIX/k
 xV3JJR8xGh8dN34nfVBiW17yiyC0dmc0pKnV6ZWE98WpJGKEn9Ig4NeOgfabLbDEH7sBq+nyD
 vJ9hb2XCB6TqKgZ3s1MNi2UrBb2bpi86wEHAzgyOVu0+nseV67VwSxBK6FgiZ9IDulCsExNFf
 pv9NiGU9qiiBQ307eGXHYMquT8WKAiY7k7KDF+aBxOOtcz33fNH/EImrkdiZacKvtVDAFX0CE
 9jkZGqfImaJuhw8x8I3EhuOLExUGm0ZBcO3iBfSo742V6E0XjBjZPY6ZbaW/4+GN6exweyySR
 sI4l4On9O/Xc7ucfYZjitOJIH4BNmnZi+vO/a2WzULEve7oEgDPhbiU0OGzMlsVdha6vS6ZC4
 nDwVysmxLtyOUPw/HID12lv1MLcen/y7nUFaTShycx6kr9iRry1Sa4OxyboUmwjPPqMvS5iq+
 IlW/Mp7ADa4VR0ZvaFZW7EonFRejPE30xEf40w63eWAAsq7coeSyliVOfvrllCX3jR
X-Spam-Score: 2.8 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: > This was meant to denote a context inside a window. > Then
 maybe a better prefix would be 'window-point-context'? Do we want to restrict
 this to 'point'? What about start or end positions? >> IIUC the context is
 stored but not the function to restore the position >> from the context.
 > > Indeed, there was an idea to store a function that restores point, but
 > this might be problematic [...] 
 Content analysis details:   (2.8 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (rudalics[at]gmx.at)
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [212.95.5.240 listed in zen.spamhaus.org]
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [212.227.17.20 listed in wl.mailspike.net]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [212.227.17.20 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.8 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > This was meant to denote a context inside a window. > Then
    maybe a better prefix would be 'window-point-context'? Do we want to restrict
    this to 'point'? What about start or end positions? >> IIUC the context is
    stored but not the function to restore the position >> from the context.
   > > Indeed, there was an idea to store a function that restores point, but
    > this might be problematic [...] 
 
 Content analysis details:   (1.8 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [212.95.5.240 listed in zen.spamhaus.org]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
                             low trust
                             [212.227.17.20 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [212.227.17.20 listed in wl.mailspike.net]
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (rudalics[at]gmx.at)
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

 > This was meant to denote a context inside a window.
 > Then maybe a better prefix would be 'window-point-context'?

Do we want to restrict this to 'point'? What about start or end
positions?

 >> IIUC the context is stored but not the function to restore the position
 >> from the context.
 >
 > Indeed, there was an idea to store a function that restores point, but
 > this might be problematic when saving such a function to the desktop file.

How comes?

 > Therefore, the patch has two separate functions to save and restore context
 > as mere strings and numbers.

 >>> And when the buffer is killed, there is no need
 >>> to restore a context in the killed buffer.
 >>
 >> If you don't intend to restore the context from the file the buffer was
 >> visiting.  Are you sure you don't want to do that?
 >
 > After the buffer was killed?  This doesn't seems necessary.

Then why did we provide a facility to restore the point and start of a
window via 'window-restore-killed-buffer-windows'?

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 25 Mar 2024 17:21:02 +0000
Resent-Message-ID: <handler.33871.B33871.171138726023989 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171138726023989
          (code B ref 33871); Mon, 25 Mar 2024 17:21:02 +0000
Received: (at 33871) by debbugs.gnu.org; 25 Mar 2024 17:21:00 +0000
Received: from localhost ([127.0.0.1]:36116 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1roo0K-0006Em-Ft
	for submit <at> debbugs.gnu.org; Mon, 25 Mar 2024 13:21:00 -0400
Received: from relay1-d.mail.gandi.net ([217.70.183.193]:55751)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1roo0J-0006ES-Cg
 for 33871 <at> debbugs.gnu.org; Mon, 25 Mar 2024 13:21:00 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 3D350240006;
 Mon, 25 Mar 2024 17:20:52 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <128b074a-b766-47eb-92ff-79814c900a06@HIDDEN> (martin rudalics's
 message of "Mon, 25 Mar 2024 10:41:08 +0100")
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
 <86zfuq5jxj.fsf@HIDDEN>
 <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN>
 <86plvksv1e.fsf@HIDDEN>
 <578de52d-364b-4961-b4e2-7f91cdcaa0b9@HIDDEN>
 <86frwf8w4q.fsf@HIDDEN>
 <128b074a-b766-47eb-92ff-79814c900a06@HIDDEN>
Date: Mon, 25 Mar 2024 19:10:50 +0200
Message-ID: <86v85adzmd.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> This was meant to denote a context inside a window.
>> Then maybe a better prefix would be 'window-point-context'?
>
> Do we want to restrict this to 'point'? What about start or end
> positions?

It's impossible to keep window-start and window-end intact
when text in the buffer changes.

>>> IIUC the context is stored but not the function to restore the position
>>> from the context.
>>
>> Indeed, there was an idea to store a function that restores point, but
>> this might be problematic when saving such a function to the desktop file.
>
> How comes?

Because a function is not writable.

>> Therefore, the patch has two separate functions to save and restore context
>> as mere strings and numbers.
>
>>>> And when the buffer is killed, there is no need
>>>> to restore a context in the killed buffer.
>>>
>>> If you don't intend to restore the context from the file the buffer was
>>> visiting.  Are you sure you don't want to do that?
>>
>> After the buffer was killed?  This doesn't seems necessary.
>
> Then why did we provide a facility to restore the point and start of a
> window via 'window-restore-killed-buffer-windows'?

'window-restore-killed-buffer-windows' already restores
point and start of a window, so there is no problem.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 26 Mar 2024 14:05:02 +0000
Resent-Message-ID: <handler.33871.B33871.171146189917481 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171146189917481
          (code B ref 33871); Tue, 26 Mar 2024 14:05:02 +0000
Received: (at 33871) by debbugs.gnu.org; 26 Mar 2024 14:04:59 +0000
Received: from localhost ([127.0.0.1]:34373 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rp7QA-0004Xt-VM
	for submit <at> debbugs.gnu.org; Tue, 26 Mar 2024 10:04:59 -0400
Received: from mout.gmx.net ([212.227.17.20]:40619)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1rp7Q5-0004XV-Cv
 for 33871 <at> debbugs.gnu.org; Tue, 26 Mar 2024 10:04:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1711461887; x=1712066687; i=rudalics@HIDDEN;
 bh=LZhrew8asNsToJfLgz6XCaSf0ck1ozlfyGrCeHrazDY=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:
 In-Reply-To;
 b=l3HHHSopTQKZVN/2RLJX0Hw2+5qNuRaZ04QSOoZ8GMlcG5OoMSgrpH03YuIEXx3v
 C4oWByuZkGuYbvxj9f/7z8R5cjD/RdfJlF73s4S4bqQxk4Q1sGP3pe9V3nacLL2Zo
 C727/tv2Z08lsCa3E9K/tIgmJiEhFUtk7mt1wDMo3MvFYN5tEfjVeGIiXYR63cI8A
 3jyX3Mx03b85vPdH7UR+06cHWemq606vwbahGwKUmyScEVdgh99DweKtLuIG/C3xs
 TXZxv4azzkMDfNh/SphUCXFFNu2ZBqoJSUNcUUEkQANfLT/OtnPoCDodV1/8y0iqm
 K3SO2XQCMFLK8ttAXQ==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([213.142.96.219]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MkYXm-1sZh1Y0PU6-00m74X; Tue, 26
 Mar 2024 10:55:38 +0100
Message-ID: <a79ac121-cca7-4f41-a241-29f1f09aca6a@HIDDEN>
Date: Tue, 26 Mar 2024 10:55:37 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <87bm59mglk.fsf@HIDDEN> <86fsoaq4lo.fsf@HIDDEN>
 <dfec786c-3037-60ea-bed2-715f7c40e898@HIDDEN>
 <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
 <86zfuq5jxj.fsf@HIDDEN>
 <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN>
 <86plvksv1e.fsf@HIDDEN>
 <578de52d-364b-4961-b4e2-7f91cdcaa0b9@HIDDEN>
 <86frwf8w4q.fsf@HIDDEN>
 <128b074a-b766-47eb-92ff-79814c900a06@HIDDEN>
 <86v85adzmd.fsf@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86v85adzmd.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:PsgvPU7Vo58pXl8uSaJGiCgbOnF8p3J3Tu1wu92JKrERX4cmZrK
 Hcvdllglx28FXLfBmWRLlkCFL/73BVzH3j4RNZ0b4KJ8lmCclBw4GnJwFEysyfDAWpQtU3e
 IwqsQVw4EARoZtM8lT3xiMGDmKRENa9WMnpdeBms7JcUCzwaAQMpwifdSWcSbmniEHbRE6F
 /DGHASAtL9H+1qtxVdQeA==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:xz4nlclKxv0=;7z9f5acTebkds2XNek4TE1tC4el
 a+GqXhfyDpkYAV3j9aJVtuztR8Py3Y8LqzjaDocTXlFNuxXi1CNU/NOWWXtiSYuLqOJYW/Qdv
 RCuh9VnBC3ZIPmwMKLkGsVsMBpvrmZ7InIuG6Rf3sqJT3+EOx+KVLzBDm8Sb0rmKXgVFT6bkX
 RWXLh2gQBLovkn+/7ZJQga5pM6lKKknycXhK0Wq/YYdGtPmbnlykpk/EX623v1ORPEfCFyD5r
 73kDtDZsj65Zo6CTe9XPIsZrVEKSNsgEKpHnlwDw08EzYLsqEUTqOVBz11g9WLORfuNySNuxk
 zoT0UJALqIT+hYGMky/bJwCVqM9xVixPwRqxtTZnUgLQn4v16qdQZxRrEpGKKfqWuyxVnlg0Q
 7VYgFsi0bfm7ce8l/EzbGCAi1t996Gktx/s1AtCQq4OoiqOsn3+LBMvCk7ivxXnf1v26LJLCm
 eUHkOe1KRh05kVEm3xZCbEtQrg2dmIbe1LBZTCI5qhVQ8c+RXH9Vd8YD1Q/wLyUfVC9gXdoCG
 4Sv5agWiNbwmitWVOBZLtff7fFAehqparxfZJnPhF8y/tUwaqTpK0yDq+/WoHu806uGb6BDaQ
 Kk61cUsvTlCf2sSLHfZCFikUWeVYSmcnZJMWk3cHYiZgYq1/sb3TIf0XjgmDMAPkBCEdqrNJA
 2x5azjLbA0boMwq1caFEBFi+6KqUUEh367ghkkV9lHaBKo15tLTaIQSnc/MGW0Rta0CrL2HMC
 yBeayvvn4XdLNJweAdgyEV4iYTGz7T70DjWu11Q2heMMO42ZVWyPlWXiKpipB+LXwwG6xTh7x
 s6E6SwOiybYZX3YwUjmIhuebz+90KgOaXw2lXaxA766bg=
X-Spam-Score: 2.8 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: > It's impossible to keep window-start and window-end intact
 > when text in the buffer changes. It would depend on the change. > Because
 a function is not writable. 
 Content analysis details:   (2.8 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (rudalics[at]gmx.at)
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [212.227.17.20 listed in list.dnswl.org]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [213.142.96.219 listed in zen.spamhaus.org]
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [212.227.17.20 listed in wl.mailspike.net]
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.8 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > It's impossible to keep window-start and window-end intact
    > when text in the buffer changes. It would depend on the change. > Because
    a function is not writable. 
 
 Content analysis details:   (1.8 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
                             low trust
                             [212.227.17.20 listed in list.dnswl.org]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [213.142.96.219 listed in zen.spamhaus.org]
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [212.227.17.20 listed in wl.mailspike.net]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (rudalics[at]gmx.at)
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

 > It's impossible to keep window-start and window-end intact
 > when text in the buffer changes.

It would depend on the change.

 > Because a function is not writable.

A function name is.

 > 'window-restore-killed-buffer-windows' already restores
 > point and start of a window, so there is no problem.

OK.  I won't insist.

martin





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 28 Mar 2024 07:58:02 +0000
Resent-Message-ID: <handler.33871.B33871.171161263616863 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171161263616863
          (code B ref 33871); Thu, 28 Mar 2024 07:58:02 +0000
Received: (at 33871) by debbugs.gnu.org; 28 Mar 2024 07:57:16 +0000
Received: from localhost ([127.0.0.1]:38948 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rpkdJ-0004NL-Ov
	for submit <at> debbugs.gnu.org; Thu, 28 Mar 2024 03:57:15 -0400
Received: from relay9-d.mail.gandi.net ([2001:4b98:dc4:8::229]:53411)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1rpkdD-0004MX-W6
 for 33871 <at> debbugs.gnu.org; Thu, 28 Mar 2024 03:57:08 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id C0C0DFF802;
 Thu, 28 Mar 2024 07:56:55 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <a79ac121-cca7-4f41-a241-29f1f09aca6a@HIDDEN> (martin rudalics's
 message of "Tue, 26 Mar 2024 10:55:37 +0100")
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
 <86zfuq5jxj.fsf@HIDDEN>
 <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN>
 <86plvksv1e.fsf@HIDDEN>
 <578de52d-364b-4961-b4e2-7f91cdcaa0b9@HIDDEN>
 <86frwf8w4q.fsf@HIDDEN>
 <128b074a-b766-47eb-92ff-79814c900a06@HIDDEN>
 <86v85adzmd.fsf@HIDDEN>
 <a79ac121-cca7-4f41-a241-29f1f09aca6a@HIDDEN>
Date: Thu, 28 Mar 2024 09:40:47 +0200
Message-ID: <86le62vpew.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain

>> 'window-restore-killed-buffer-windows' already restores
>> point and start of a window, so there is no problem.
>
> OK.  I won't insist.

So now here is the final patch:


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=window-point-context.patch

diff --git a/lisp/window.el b/lisp/window.el
index df55a7ca673..1ec45027f4c 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -10834,6 +10872,77 @@ window--adjust-process-windows
                 (set-process-window-size process (cdr size) (car size))))))))))
 
 (add-hook 'window-configuration-change-hook 'window--adjust-process-windows)
+
+
+;;; Window point context
+
+(defun window-point-context-set ()
+  "Set context near the window point.
+Call `window-point-context-set-function' to get the context near the window
+point of every window on the frame.  This function is called with the
+window argument.  During the call the current buffer is set to the window
+buffer, but its window is not selected.  It's expected that the called
+function will use the window point to return a data structure that will
+help later to find the same location again.  After the call remember the
+returned context in the window parameter `context'."
+  (walk-windows
+   (lambda (w)
+     (with-current-buffer (window-buffer w)
+       (when-let (((functionp window-point-context-set-function))
+                  (context (funcall window-point-context-set-function w)))
+         (set-window-parameter w 'context (cons (buffer-name) context)))))
+   'nomini))
+
+(defun window-point-context-use ()
+  "Use context to relocate the window point.
+Call `window-point-context-use-function' to move the window point according
+to the previously saved context.  For every window on the frame this
+function is called with two agreements: the window and the context data
+structure saved by `window-point-context-set-function' in the window
+parameter `context'.  During the call the current buffer is set to the
+window buffer, but its window is not selected.  It's expected that the
+called function will set the window point to the location found by using
+the provided context."
+  (walk-windows
+   (lambda (w)
+     (with-current-buffer (window-buffer w)
+       (when-let (((functionp window-point-context-use-function))
+                  (context (window-parameter w 'context))
+                  ((equal (buffer-name) (car context))))
+         (funcall window-point-context-use-function w (cdr context))
+         (set-window-parameter w 'context nil))))
+   'nomini))
+
+(add-to-list 'window-persistent-parameters '(context . writable))
+
+(defun window-point-context-set-default-function (w)
+  "Set context of file buffers to the front and rear strings."
+  (when buffer-file-name
+    (let ((point (window-point w)))
+      `((front-context-string
+         . ,(buffer-substring-no-properties
+             point (min (+ point 16) (point-max))))
+        (rear-context-string
+         . ,(buffer-substring-no-properties
+             point (max (- point 16) (point-min))))))))
+
+(defun window-point-context-use-default-function (w context)
+  "Restore context of file buffers by the front and rear strings."
+  (let ((point (window-point w)))
+    (save-excursion
+      (goto-char point)
+      (when-let ((f (alist-get 'front-context-string context))
+                 ((search-forward f (point-max) t)))
+        (goto-char (match-beginning 0))
+        (when-let ((r (alist-get 'rear-context-string context))
+                   ((search-backward r (point-min) t)))
+          (goto-char (match-end 0))
+          (setq point (point)))))
+    (set-window-point w point)))
+
+(defvar window-point-context-set-function 'window-point-context-set-default-function)
+(defvar window-point-context-use-function 'window-point-context-use-default-function)
+
 
 ;; Some of these are in tutorial--default-keys, so update that if you
 ;; change these.
diff --git a/lisp/dired.el b/lisp/dired.el
index 9e3b888df14..3eb4351c93e 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2743,6 +2745,24 @@ dired-mode
               '(dired-font-lock-keywords t nil nil beginning-of-line))
   (setq-local desktop-save-buffer 'dired-desktop-buffer-misc-data)
   (setq-local grep-read-files-function #'dired-grep-read-files)
+  (setq-local window-point-context-set-function
+              (lambda (w)
+                (let ((point (window-point w)))
+                  (save-excursion
+                    (goto-char point)
+                    (if-let ((f (dired-get-filename nil t)))
+                        `((dired-filename . ,f))
+                      `((position . ,(point))))))))
+  (setq-local window-point-context-use-function
+              (lambda (w context)
+                (let ((point (window-point w)))
+                  (save-excursion
+                    (if-let ((f (alist-get 'dired-filename context)))
+                        (dired-goto-file f)
+                      (when-let ((p (alist-get 'position context)))
+                        (goto-char p)))
+                    (setq point (point)))
+                  (set-window-point w point))))
   (setq dired-switches-alist nil)
   (hack-dir-local-variables-non-file-buffer) ; before sorting
   (dired-sort-other dired-actual-switches t)
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index fa22500a04e..ca0c92e903f 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1292,6 +1292,9 @@ tab-bar--tab
                                            frame 'buffer-list)))
          (bbl (seq-filter #'buffer-live-p (frame-parameter
                                            frame 'buried-buffer-list))))
+    (when tab-bar-select-restore-context
+      (window-point-context-set))
+
     `(tab
       (name . ,(if tab-explicit-name
                    (alist-get 'name tab)
@@ -1442,6 +1445,12 @@ tab-bar-select-restore-windows
           (setq buffer-read-only t)
           (set-window-buffer window new-buffer))))))
 
+(defcustom tab-bar-select-restore-context t
+  "Non-nil to restore context of the selected tab."
+  :type 'boolean
+  :group 'tab-bar
+  :version "30.1")
+
 (defvar tab-bar-minibuffer-restore-tab nil
   "Tab number for `tab-bar-minibuffer-restore-tab'.")
 
@@ -1539,6 +1548,9 @@ tab-bar-select-tab
             (select-window (get-mru-window)))
           (window-state-put ws nil 'safe)))
 
+        (when tab-bar-select-restore-context
+          (window-point-context-use))
+
         ;; Select the minibuffer when it was active before switching tabs
         (when (and minibuffer-was-active (active-minibuffer-window))
           (select-window (active-minibuffer-window)))

--=-=-=--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 28 Mar 2024 09:19:02 +0000
Resent-Message-ID: <handler.33871.B33871.17116175059444 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.17116175059444
          (code B ref 33871); Thu, 28 Mar 2024 09:19:02 +0000
Received: (at 33871) by debbugs.gnu.org; 28 Mar 2024 09:18:25 +0000
Received: from localhost ([127.0.0.1]:39038 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rpltw-0002S8-9k
	for submit <at> debbugs.gnu.org; Thu, 28 Mar 2024 05:18:24 -0400
Received: from mout.gmx.net ([212.227.17.21]:44939)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1rpltt-0002RH-ED
 for 33871 <at> debbugs.gnu.org; Thu, 28 Mar 2024 05:18:23 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1711617494; x=1712222294; i=rudalics@HIDDEN;
 bh=pC6OLJjJU/rXJ9Q4OJPt9BSRRuWj8V2NeGO4bvITXWw=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:
 In-Reply-To;
 b=U/jK70Is9N8p50kQ2BMEdm0teQksG/DKUhAHubWPpuhXB3uRYiP2hNkBm0azJv5t
 PZH9N/+6P4y/g+2Vf75XnJX4oWkKXBnOltMB/i64izMSGTmEWwUx4clNfR9F1UQ0r
 AaiAfJt22RDFj5Pjqo/3D66HLU5pGQLHN7WUgmRx4WgGt6KkA1CLK/NTerzuVGV/w
 nqGWMcZl5NsE+I+W8WLQG2TEQoXP53U+XXffMt/pwkHLg2/IC87irmJcwjpPPWxjM
 YeDGwWS2qLnexlFzIdONHhbxBZTij3DlRlA8WYzuJkHHBH1qFd5aJp52ialWCb+lM
 cs2tiqmaBI2tbRBovw==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([213.142.97.35]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mf0BG-1sWFWJ24uA-00gX9n; Thu, 28
 Mar 2024 10:18:13 +0100
Message-ID: <b395cbc1-a8cb-457a-9942-63385eb74ff1@HIDDEN>
Date: Thu, 28 Mar 2024 10:18:12 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <87bm59mglk.fsf@HIDDEN> <86tucp7dbp.fsf@HIDDEN>
 <37e2129c-464f-7f0a-0870-f7360ca21dc3@HIDDEN>
 <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
 <86zfuq5jxj.fsf@HIDDEN>
 <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN>
 <86plvksv1e.fsf@HIDDEN>
 <578de52d-364b-4961-b4e2-7f91cdcaa0b9@HIDDEN>
 <86frwf8w4q.fsf@HIDDEN>
 <128b074a-b766-47eb-92ff-79814c900a06@HIDDEN>
 <86v85adzmd.fsf@HIDDEN>
 <a79ac121-cca7-4f41-a241-29f1f09aca6a@HIDDEN>
 <86le62vpew.fsf@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86le62vpew.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:FPhCIVnBFh0nAXfaTbcMW+0s+Dnxffxf+SZqreRycU3Ni/fbETk
 OVNUci7T3RO1Gd8zJfduom4z8qUNbiJBPWknBfCCm5UwJSRm8J9VUfC6dEt7WykgF4Jsspn
 S7Qjqx/V3+pLMm6DG6E2DsnqgF9MiHGnPTLskxrlNlDSRchJIyR2rIeo0YzvAEhys1KV7FN
 QSHWjDV7nxaBvHMd/RtPw==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:pIXmn/2l2jM=;KrLy9E7Cs8coKXMsyBTz/lYGF7f
 VULKOZD4FUWHoGTD1epKX1nGgoLs3e4qP4gJ9TIkTFzSMnfRxs3j9MuC52/ONlr6PxDYsRyMv
 5NKORj1FBwTJck0ZFwYB2yt016o8niQwVi0QLwx2l2uGUR2B+0tK7gnvdEl4bMgh9KvmY4V5s
 zx0VQzLhIcuKARwTiuTSAGFiuz+U9aI9CEDIOUSAEB0W1IlOvqtNR15XX13RASnpu93o/1foi
 LFRw3/aa5/maImEzTpPTMeTuhk7ZbVtTS+jLXCshMd+PRcZ0ZbA/81DWyl5YLcPqlVy1XzwCZ
 pJDc+5l+E6EXxfS5EJoQVY0A646CTdU6UWoTxytzmB/p3Lcu1zR6HqHA01rNJzuiB8SPV6DfE
 Sm0DyFXGG2AIltPMxKNqqTjuXPttgx3wU3A1dl4cdMXCOvhX6swKlzQU0kd8D+nfPvfmggfnM
 L4ei+uNrOSCNnr1Fpdf/kvndeNSyf5LcX18BN4EHj5kMypxsfwiHEbK/a0iVleMWEXyUQsdr7
 wPIVZw+CvpmB1uCaVB0RJ/0JOM8//o4HUpe76u1blM9Xo3C6bph57pVZOwiYCOndOSnMsMdf4
 btceMBMp5uVH1XhO/IEWk1oBYLjGZr8iFvxhJl9kfl69jNPr8FtGwAkGlhbJDqtQe3jKnM4J9
 Y1zlG39DynhYFLVbH47/i4gZytICYqjWOVzl0ijJ4Uw1wHa/gaw9zZdNCCa2yRK0M5EkMldvk
 nydw/cQqccpzZONPCe18AUpwj010dG06E9ULJCY2aZjli4p1Atp6Kk94PyBxwdEuajgS4IpRb
 SNhXAf3aKqt7Kyno5kjfnX2mkAOwcdhWHJZK2AjWGiZHM=
X-Spam-Score: 2.8 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: > So now here is the final patch: For
 'window-point-context-set'
 I'd rather write something like: Call function specified by
 `window-point-context-set-function'
 for every live window on the selected frame with that window as sole argument
 and that window's buffer current. The function called is s [...] 
 Content analysis details:   (2.8 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [213.142.97.35 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (rudalics[at]gmx.at)
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [212.227.17.21 listed in wl.mailspike.net]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [212.227.17.21 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.8 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > So now here is the final patch: For 'window-point-context-set'
    I'd rather write something like: Call function specified by `window-point-context-set-function'
    for every live window on the selected frame with that window as sole argument
    and that window's buffer current. The function called is s [...] 
 
 Content analysis details:   (1.8 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
                             low trust
                             [212.227.17.21 listed in list.dnswl.org]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [213.142.97.35 listed in zen.spamhaus.org]
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [212.227.17.21 listed in wl.mailspike.net]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (rudalics[at]gmx.at)
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

 > So now here is the final patch:

For 'window-point-context-set' I'd rather write something like:

   Call function specified by `window-point-context-set-function' for ever=
y
   live window on the selected frame with that window as sole argument and
   that window's buffer current.  The function called is supposed to retur=
n
   a context of the window's point that can be later used as argument for
   `window-point-context-use'.  Remember the returned context in the windo=
w
   parameter `context'.

+function is called with two agreements: the window and the context data
                              ^^^^^^^^^^

I still don't get why you use 'with-current-buffer' here.  IIUC usually
a buffer does not have 'window-point-context-set-function' set and so a
simple

(buffer-local-value 'window-point-context-set-function (window-buffer w))

should suffice.

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 28 Mar 2024 18:06:02 +0000
Resent-Message-ID: <handler.33871.B33871.17116491117660 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.17116491117660
          (code B ref 33871); Thu, 28 Mar 2024 18:06:02 +0000
Received: (at 33871) by debbugs.gnu.org; 28 Mar 2024 18:05:11 +0000
Received: from localhost ([127.0.0.1]:41100 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rpu7h-0001z6-1S
	for submit <at> debbugs.gnu.org; Thu, 28 Mar 2024 14:05:11 -0400
Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]:51941)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1rpu7a-0001xd-6G
 for 33871 <at> debbugs.gnu.org; Thu, 28 Mar 2024 14:05:03 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 2EC0BE0008;
 Thu, 28 Mar 2024 18:04:55 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <b395cbc1-a8cb-457a-9942-63385eb74ff1@HIDDEN> (martin rudalics's
 message of "Thu, 28 Mar 2024 10:18:12 +0100")
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
 <86zfuq5jxj.fsf@HIDDEN>
 <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN>
 <86plvksv1e.fsf@HIDDEN>
 <578de52d-364b-4961-b4e2-7f91cdcaa0b9@HIDDEN>
 <86frwf8w4q.fsf@HIDDEN>
 <128b074a-b766-47eb-92ff-79814c900a06@HIDDEN>
 <86v85adzmd.fsf@HIDDEN>
 <a79ac121-cca7-4f41-a241-29f1f09aca6a@HIDDEN>
 <86le62vpew.fsf@HIDDEN>
 <b395cbc1-a8cb-457a-9942-63385eb74ff1@HIDDEN>
Date: Thu, 28 Mar 2024 19:54:52 +0200
Message-ID: <86sf0actmb.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain

>> So now here is the final patch:
>
> For 'window-point-context-set' I'd rather write something like:
>
>   Call function specified by `window-point-context-set-function' for every
>   live window on the selected frame with that window as sole argument and
>   that window's buffer current.  The function called is supposed to return
>   a context of the window's point that can be later used as argument for
>   `window-point-context-use'.  Remember the returned context in the window
>   parameter `context'.

Thanks for the suggestion, this is added in a new patch.

> I still don't get why you use 'with-current-buffer' here.  IIUC usually
> a buffer does not have 'window-point-context-set-function' set and so a
> simple
>
> (buffer-local-value 'window-point-context-set-function (window-buffer w))
>
> should suffice.

Ok, let's use buffer-local-value:


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=window-point-context.patch

diff --git a/lisp/window.el b/lisp/window.el
index df55a7ca673..3998f869855 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -10834,6 +10878,78 @@ window--adjust-process-windows
                 (set-process-window-size process (cdr size) (car size))))))))))
 
 (add-hook 'window-configuration-change-hook 'window--adjust-process-windows)
+
+
+;;; Window point context
+
+(defun window-point-context-set ()
+  "Set context near the window point.
+Call function specified by `window-point-context-set-function' for every
+live window on the selected frame with that window as sole argument.
+The function called is supposed to return a context of the window's point
+that can be later used as argument for `window-point-context-use-function'.
+Remember the returned context in the window parameter `context'."
+  (walk-windows
+   (lambda (w)
+     (when-let ((fn (buffer-local-value 'window-point-context-set-function
+                                        (window-buffer w)))
+                ((functionp fn))
+                (context (funcall fn w)))
+       (set-window-parameter w 'context (cons (buffer-name) context))))
+   'nomini))
+
+(defun window-point-context-use ()
+  "Use context to relocate the window point.
+Call function specified by `window-point-context-use-function' to move the
+window point according to the previously saved context.  For every live
+window on the selected frame this function is called with two arguments:
+the window and the context data structure saved by
+`window-point-context-set-function' in the window parameter `context'.
+The function called is supposed to set the window point to the location
+found by the provided context."
+  (walk-windows
+   (lambda (w)
+     (when-let ((fn (buffer-local-value 'window-point-context-use-function
+                                        (window-buffer w)))
+                ((functionp fn))
+                (context (window-parameter w 'context))
+                ((equal (buffer-name) (car context))))
+       (funcall fn w (cdr context))
+       (set-window-parameter w 'context nil)))
+   'nomini))
+
+(add-to-list 'window-persistent-parameters '(context . writable))
+
+(defun window-point-context-set-default-function (w)
+  "Set context of file buffers to the front and rear strings."
+  (with-current-buffer (window-buffer w)
+    (when buffer-file-name
+      (let ((point (window-point w)))
+        `((front-context-string
+           . ,(buffer-substring-no-properties
+               point (min (+ point 16) (point-max))))
+          (rear-context-string
+           . ,(buffer-substring-no-properties
+               point (max (- point 16) (point-min)))))))))
+
+(defun window-point-context-use-default-function (w context)
+  "Restore context of file buffers by the front and rear strings."
+  (with-current-buffer (window-buffer w)
+    (let ((point (window-point w)))
+      (save-excursion
+        (goto-char point)
+        (when-let ((f (alist-get 'front-context-string context))
+                   ((search-forward f (point-max) t)))
+          (goto-char (match-beginning 0))
+          (when-let ((r (alist-get 'rear-context-string context))
+                     ((search-backward r (point-min) t)))
+            (goto-char (match-end 0))
+            (setq point (point)))))
+      (set-window-point w point))))
+
+(defvar window-point-context-set-function 'window-point-context-set-default-function)
+(defvar window-point-context-use-function 'window-point-context-use-default-function)
+
 
 ;; Some of these are in tutorial--default-keys, so update that if you
 ;; change these.
diff --git a/lisp/dired.el b/lisp/dired.el
index 9e3b888df14..0c73ae31e96 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2743,6 +2745,26 @@ dired-mode
               '(dired-font-lock-keywords t nil nil beginning-of-line))
   (setq-local desktop-save-buffer 'dired-desktop-buffer-misc-data)
   (setq-local grep-read-files-function #'dired-grep-read-files)
+  (setq-local window-point-context-set-function
+              (lambda (w)
+                (with-current-buffer (window-buffer w)
+                  (let ((point (window-point w)))
+                    (save-excursion
+                      (goto-char point)
+                      (if-let ((f (dired-get-filename nil t)))
+                          `((dired-filename . ,f))
+                        `((position . ,(point)))))))))
+  (setq-local window-point-context-use-function
+              (lambda (w context)
+                (with-current-buffer (window-buffer w)
+                  (let ((point (window-point w)))
+                    (save-excursion
+                      (if-let ((f (alist-get 'dired-filename context)))
+                          (dired-goto-file f)
+                        (when-let ((p (alist-get 'position context)))
+                          (goto-char p)))
+                      (setq point (point)))
+                    (set-window-point w point)))))
   (setq dired-switches-alist nil)
   (hack-dir-local-variables-non-file-buffer) ; before sorting
   (dired-sort-other dired-actual-switches t)
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index fa22500a04e..95bf3f9bc81 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1292,6 +1292,9 @@ tab-bar--tab
                                            frame 'buffer-list)))
          (bbl (seq-filter #'buffer-live-p (frame-parameter
                                            frame 'buried-buffer-list))))
+    (when tab-bar-select-restore-context
+      (window-point-context-set))
+
     `(tab
       (name . ,(if tab-explicit-name
                    (alist-get 'name tab)
@@ -1442,6 +1445,16 @@ tab-bar-select-restore-windows
           (setq buffer-read-only t)
           (set-window-buffer window new-buffer))))))
 
+(defcustom tab-bar-select-restore-context t
+  "Non-nil to restore previous context in every window of the selected tab.
+This will try to find the same position in the buffer where point was
+before switching away from this tab.  After selecting this tab again,
+point will be moved to its previous place in the buffer even when
+buffer was modified."
+  :type 'boolean
+  :group 'tab-bar
+  :version "30.1")
+
 (defvar tab-bar-minibuffer-restore-tab nil
   "Tab number for `tab-bar-minibuffer-restore-tab'.")
 
@@ -1539,6 +1552,9 @@ tab-bar-select-tab
             (select-window (get-mru-window)))
           (window-state-put ws nil 'safe)))
 
+        (when tab-bar-select-restore-context
+          (window-point-context-use))
+
         ;; Select the minibuffer when it was active before switching tabs
         (when (and minibuffer-was-active (active-minibuffer-window))
           (select-window (active-minibuffer-window)))

--=-=-=--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 29 Mar 2024 08:46:01 +0000
Resent-Message-ID: <handler.33871.B33871.171170191420916 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171170191420916
          (code B ref 33871); Fri, 29 Mar 2024 08:46:01 +0000
Received: (at 33871) by debbugs.gnu.org; 29 Mar 2024 08:45:14 +0000
Received: from localhost ([127.0.0.1]:41675 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rq7rN-0005RE-I5
	for submit <at> debbugs.gnu.org; Fri, 29 Mar 2024 04:45:13 -0400
Received: from mout.gmx.net ([212.227.15.18]:47669)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1rq7rL-0005QR-T2
 for 33871 <at> debbugs.gnu.org; Fri, 29 Mar 2024 04:45:12 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1711701904; x=1712306704; i=rudalics@HIDDEN;
 bh=FwDELuz07tiDAkkZnYFUD+SpzGBh0gQu1S0rfQ38Qig=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:
 In-Reply-To;
 b=S9Dn60IGuIT/zYZNBmE9LCxmDsK8OQR2hR+0Vkz55KD9kqg9sbCKewzbMlWh3z8K
 reJmZShlnx5XcDTbjw39qk8EeNhgeCDn4C2iOp/4BwTNGm/804lDHKJ0wGgLDed8a
 pZV+7CURJTU7a6w3YSOQmGFlJarDhYU/0t7bzSwShfuvky1dXkyivDOlzN/lITYK+
 E7c8bTXaNYXEEoQ51+jUUX/NOdeC/8oXSUxmvflj26GMax4ETnUqnJXleF9aIUXUW
 ORUMpNeSAH6csfbMtcIP6FlX+8JoDIJwjC/AWNlBKo2rzZUjYIJXT+aSTMH7ZqT7X
 XZpiJ9TA+eftHtJgUQ==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([46.125.249.18]) by mail.gmx.net (mrgmx005
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N5G9n-1sovSP1hkT-011Eua; Fri, 29
 Mar 2024 09:45:04 +0100
Message-ID: <140cbfe8-c2b7-42cf-9500-82e2eab1278e@HIDDEN>
Date: Fri, 29 Mar 2024 09:45:03 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <87bm59mglk.fsf@HIDDEN> <86zfw07tbw.fsf@HIDDEN>
 <96fd3170-e5d2-4d16-93ec-c6fff3efb787@HIDDEN>
 <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
 <86zfuq5jxj.fsf@HIDDEN>
 <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN>
 <86plvksv1e.fsf@HIDDEN>
 <578de52d-364b-4961-b4e2-7f91cdcaa0b9@HIDDEN>
 <86frwf8w4q.fsf@HIDDEN>
 <128b074a-b766-47eb-92ff-79814c900a06@HIDDEN>
 <86v85adzmd.fsf@HIDDEN>
 <a79ac121-cca7-4f41-a241-29f1f09aca6a@HIDDEN>
 <86le62vpew.fsf@HIDDEN>
 <b395cbc1-a8cb-457a-9942-63385eb74ff1@HIDDEN>
 <86sf0actmb.fsf@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86sf0actmb.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:mLdxe8ZoqhrQddkIQ04nYjq/8pv3uhS+WbXRr6gLKxXgVnJCM/e
 03Y8PaENl6MkQ2X0BaAjSBrXiURs8RCHSpT8UkQXp/fFzWkhPwx1ySloQPxN18Vb1//w4ik
 3MszYsKbcAHd38za4o25yQbLSeQT8ebrIJC+85bG8x36utdng9TrCXrmSEym72MpTxhJPSR
 7PVFWMQBQXintcD3/OEuA==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:jmcjHF5fIxE=;49XCy6i3A1OzgNpFWBztSFaeWbt
 uYV1AL4tiCYi83srPa0tmApxSlUcPwX5/rcP3OVKm1UvDNmewN+0SwlsiVf2qE6yMc9vsp6hr
 WE3pjGGA3X71tvM8Ru1XGI7kX4HRkcqoB1zgEm7+55zHd8IVm+X1ZszhX6TKUhRa+IrD7UHq8
 xb8xJSN6w7q/UjPr6Dn0RI2cQDHUQ2qbrMjnX6+JDpnHJT7LrYdhFFby70QCDn2d0pRbUpcNU
 8Za/38PeGaYetzT8OfdlrYY+uYdbsXRfgfDkccq8UB02Zvdyk+y3NmdpCCUbV1m3sK09BrBH6
 bOz0pUJonSP/WUuokvjDepsiJtWq1WCNAw/izEn81q2aSsmpnt40a1yiTl5QE4S91GO9P9lTh
 OQMT8Ugm4l72OJromYh8sOcVazG3JGVat6Fb+8MU4IQ7MyFzc4pODRyJDB2tqyJ1cmEmnOIg0
 QS6aE3PpyRBSgHPpdLtuzJMBvwiGZLM3EpBshfBP1Vg+BOmGfDBrxHMXWNDjIdLpEYVa5Hb/a
 DtjZLXglY4FOhWTadSNojR9cNt2rUPAgnkbQmiOpyZMIBJgEMBLqOZnSCWqrIO/EHxWX4IHPS
 eyB10zyjQvG7KWtk6fqtqKQ0zyiCTxyqbdnbaOETBGba1it9caL0DXtoaCuwmhyAbD3XAkR9U
 1+roxKKT/gOdcz3+D2aGJ/IzK2E+aVY+2GLp+xqpPM74DzDef/rbp/VgnxnwzbDyFMsYnwdo4
 unnCpwHJpp0CEk+ioWfwSTdiCH8t8hwHdelgeCA1SYlLWwjOVeDJkEQPTB2Sjy+9OMtXeN/pd
 I1lpWa6O6izb33qd1651pOTSAdVUSp7IphF4geGPyPQ7WEzNYvR6TSd7CLkJ4rZ2hd
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > +  "Non-nil to restore previous context in every window of the selected tab.

I'd write

"If this is non-nil, try to restore window points from their contexts.

and say what a context is next.

 > +This will try to find the same position in the buffer where point was
 > +before switching away from this tab.  After selecting this tab again,

Why "again"?

 > +point will be moved to its previous place in the buffer even when
 > +buffer was modified."

"it" or "the buffer".

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 29 Mar 2024 16:36:01 +0000
Resent-Message-ID: <handler.33871.B33871.171173015310068 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171173015310068
          (code B ref 33871); Fri, 29 Mar 2024 16:36:01 +0000
Received: (at 33871) by debbugs.gnu.org; 29 Mar 2024 16:35:53 +0000
Received: from localhost ([127.0.0.1]:43281 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rqFCq-0002cF-S4
	for submit <at> debbugs.gnu.org; Fri, 29 Mar 2024 12:35:53 -0400
Received: from relay1-d.mail.gandi.net ([217.70.183.193]:45485)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1rqFCo-0002bZ-5Z
 for 33871 <at> debbugs.gnu.org; Fri, 29 Mar 2024 12:35:51 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 35645240005;
 Fri, 29 Mar 2024 16:35:40 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <140cbfe8-c2b7-42cf-9500-82e2eab1278e@HIDDEN> (martin rudalics's
 message of "Fri, 29 Mar 2024 09:45:03 +0100")
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
 <86zfuq5jxj.fsf@HIDDEN>
 <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN>
 <86plvksv1e.fsf@HIDDEN>
 <578de52d-364b-4961-b4e2-7f91cdcaa0b9@HIDDEN>
 <86frwf8w4q.fsf@HIDDEN>
 <128b074a-b766-47eb-92ff-79814c900a06@HIDDEN>
 <86v85adzmd.fsf@HIDDEN>
 <a79ac121-cca7-4f41-a241-29f1f09aca6a@HIDDEN>
 <86le62vpew.fsf@HIDDEN>
 <b395cbc1-a8cb-457a-9942-63385eb74ff1@HIDDEN>
 <86sf0actmb.fsf@HIDDEN>
 <140cbfe8-c2b7-42cf-9500-82e2eab1278e@HIDDEN>
Date: Fri, 29 Mar 2024 18:25:07 +0200
Message-ID: <86msqhhvm4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> +  "Non-nil to restore previous context in every window of the selected tab.
>
> I'd write
>
> "If this is non-nil, try to restore window points from their contexts.
>
> and say what a context is next.
>
>> +This will try to find the same position in the buffer where point was
>> +before switching away from this tab.  After selecting this tab again,
>
> Why "again"?
>
>> +point will be moved to its previous place in the buffer even when
>> +buffer was modified."
>
> "it" or "the buffer".

Thanks for the suggestions, here is the updated docstring:

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index c51600e6c6c..009dc6eed0c 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1442,6 +1445,16 @@ tab-bar-select-restore-windows
           (setq buffer-read-only t)
           (set-window-buffer window new-buffer))))))
 
+(defcustom tab-bar-select-restore-context t
+  "If this is non-nil, try to restore window points from their contexts.
+This will try to find the same position in the buffer where point was
+before switching away from this tab.  After selecting this tab,
+point will be moved to its previous place in the buffer even when
+the buffer was modified."
+  :type 'boolean
+  :group 'tab-bar
+  :version "30.1")
+
 (defvar tab-bar-minibuffer-restore-tab nil
   "Tab number for `tab-bar-minibuffer-restore-tab'.")
 




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 30 Mar 2024 09:37:02 +0000
Resent-Message-ID: <handler.33871.B33871.17117914117332 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Juri Linkov <juri@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.17117914117332
          (code B ref 33871); Sat, 30 Mar 2024 09:37:02 +0000
Received: (at 33871) by debbugs.gnu.org; 30 Mar 2024 09:36:51 +0000
Received: from localhost ([127.0.0.1]:43977 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rqV8s-0001uB-Bn
	for submit <at> debbugs.gnu.org; Sat, 30 Mar 2024 05:36:50 -0400
Received: from mout.gmx.net ([212.227.15.19]:53761)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1rqV8p-0001tV-9K
 for 33871 <at> debbugs.gnu.org; Sat, 30 Mar 2024 05:36:48 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1711791398; x=1712396198; i=rudalics@HIDDEN;
 bh=WuDIyhlYZLHQVTNNbB0KnAb4C9Q33O6wOtUzaZHLoSc=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:
 In-Reply-To;
 b=iAhF3XUY3oc46yUIaPKCl960O8GtDIlEOzTFkDb4F8bUBkMNFXvj9daDwQt2CQqH
 /jqL/eE2yQy/zQfM191o1TpHouZltO2eZ/Y13/0VEti0n9FpmyC6igHLrxu14ITZf
 ggeJ4PK51IhaYZ2ZilTGB4otwPVDRr2sbW89B+KB6rqXahMJgbu5beDDGWQ8+Atd0
 BUrWo2Du/Z3lfi7ArIH2kNIbb3KuBF4zJ+ngehf+A0NqHyTM7od9PIm7d0LRypcwM
 /YB8gDG4huWCxTRoqFN3yXDBCa7GI+l9ApEJ90PoNgPuFQ1aCwbQ29mnWlocj3vKE
 3KhO0N2eY4yZKuHhoA==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([46.125.249.110]) by mail.gmx.net (mrgmx004
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MgvvT-1sUkuZ2SDN-00hPYM; Sat, 30
 Mar 2024 10:36:38 +0100
Message-ID: <a272da1d-3f82-49e9-964a-7c8514e925e8@HIDDEN>
Date: Sat, 30 Mar 2024 10:36:37 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <87bm59mglk.fsf@HIDDEN> <86wmr2w7to.fsf@HIDDEN>
 <3808f9f8-624a-449c-8572-085582395859@HIDDEN>
 <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
 <86zfuq5jxj.fsf@HIDDEN>
 <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN>
 <86plvksv1e.fsf@HIDDEN>
 <578de52d-364b-4961-b4e2-7f91cdcaa0b9@HIDDEN>
 <86frwf8w4q.fsf@HIDDEN>
 <128b074a-b766-47eb-92ff-79814c900a06@HIDDEN>
 <86v85adzmd.fsf@HIDDEN>
 <a79ac121-cca7-4f41-a241-29f1f09aca6a@HIDDEN>
 <86le62vpew.fsf@HIDDEN>
 <b395cbc1-a8cb-457a-9942-63385eb74ff1@HIDDEN>
 <86sf0actmb.fsf@HIDDEN>
 <140cbfe8-c2b7-42cf-9500-82e2eab1278e@HIDDEN>
 <86msqhhvm4.fsf@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86msqhhvm4.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:DD5FBeRRpAgD/Gif7e1Cgl96wcWm6MBxs1lIqOaU/0zbPklBBoE
 FqCRW1JNAFQDLOkXZq/IyqAgEoLzjSltQypTPlPCli8AjvIMXGP2rcY0x4+QG4T4MyNqPlk
 9i5KLbS8pZhwFpxn9NMIvX+svFLHCvUXd7WVklUxrE4kvpM/onwlVXxiS/sRbsxlAYhMHde
 AG90n6cSgBI29MHGTVP5g==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:wi0lAmAD/vM=;ywEr0bQc5hNEu7ZXnDmrX1CNNrv
 wSqYkQm6FaPSEFi/GnC1YFKqjgPkQPzVj/5rIytREttD/symN4uLnuPIDJ16wsc1wbQYf3deH
 jRzZfM5zcGGWvtvYN5dZFWY7k10d42A43L2ii3C4oA9wuRRoTElfAyauVrLXleLrJz0GvrCq1
 6FFK6PI4aXB12lOd6yOGYl1mQqyF1pr/U4aIZzui2RMH5rtcY1uy2maZ5Uxqi5iOo2x1TimGO
 wUShmvOmv7xqx2MRDgEEG0Xi2pzW+aOddOd1QST1OEdlQGmsVS0Yb3NTgjD93s6yfLHRdDet1
 4swEZ1fX7SB7AmeWGYXILoQ9xFNxkB8IICdfPpJiLN1DqXE2A5EyJVoBr0gny25Fkra8rfQeO
 75BD00cfboR+Hs7oLTuPKxQlvof1bY6F14TxYPq9jpxI0iaNUfjnIo/EG66uhJghMrICDkpjp
 hB5amVgHNTQQAaVfHMZZkrr0eaz0N9pnOnkDJ2Mo4r2FHPEm2Z12+wyfE0pQdyDXnpWPpdvfr
 E2g96V4kvesiG/r9uB5Sa+NRphFFmdxIiGDHLp0bJ51WgulycpQQLA/F74utiS/bEePaF97S9
 HDmZXc81HeaKVt7b068oMafbFRlOlXUEbzgmqHZ1wf2lGYL5pckD++cSzewr0TZmyU6LCVnL1
 IJXJfbR0RT0sNEp7pUnepmzdNjeoCc+BDxelrwYErnCuwFeMTEgHBR4CHEg6z3WAOLCfXwnNz
 MN6aHa5brKnYQPpgEhktlADZhLuvD8w/K2SqXC1NBWYuOdVDUAyEckKFz1+J/JPuf974N+NKM
 74XYBc/Oytls89BXMNOcGaJG+AHeVFl8SgNkqTVlDAjr8=
X-Spam-Score: 4.3 (++++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  > + "If this is non-nil, try to restore window points from
 their contexts. > +This will try to find the same position in the buffer
 where point was > +before switching away from this tab. After selec [...] 
 Content analysis details:   (4.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [46.125.249.110 listed in zen.spamhaus.org]
 1.5 RCVD_IN_SORBS_WEB      RBL: SORBS: sender is an abusable web server
 [46.125.249.110 listed in dnsbl.sorbs.net]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [212.227.15.19 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (rudalics[at]gmx.at)
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [212.227.15.19 listed in wl.mailspike.net]
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 3.3 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > + "If this is non-nil, try to restore window points from
    their contexts. > +This will try to find the same position in the buffer
   where point was > +before switching away from this tab. After selec [...] 
 
 Content analysis details:   (3.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
                             low trust
                             [212.227.15.19 listed in list.dnswl.org]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [46.125.249.110 listed in zen.spamhaus.org]
  1.5 RCVD_IN_SORBS_WEB      RBL: SORBS: sender is an abusable web server
                             [46.125.249.110 listed in dnsbl.sorbs.net]
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [212.227.15.19 listed in wl.mailspike.net]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (rudalics[at]gmx.at)
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

 > +  "If this is non-nil, try to restore window points from their contexts.
 > +This will try to find the same position in the buffer where point was
 > +before switching away from this tab.  After selecting this tab,
 > +point will be moved to its previous place in the buffer even when
 > +the buffer was modified."

"this window's point" instead of "point" and "position" instead of
"place" would be more precise.

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 30 Mar 2024 18:25:02 +0000
Resent-Message-ID: <handler.33871.B33871.171182308424819 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171182308424819
          (code B ref 33871); Sat, 30 Mar 2024 18:25:02 +0000
Received: (at 33871) by debbugs.gnu.org; 30 Mar 2024 18:24:44 +0000
Received: from localhost ([127.0.0.1]:46145 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rqdNk-0006S9-5w
	for submit <at> debbugs.gnu.org; Sat, 30 Mar 2024 14:24:44 -0400
Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]:36171)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1rqdNh-0006RA-Ox
 for 33871 <at> debbugs.gnu.org; Sat, 30 Mar 2024 14:24:42 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 1C7EB40005;
 Sat, 30 Mar 2024 18:24:31 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <a272da1d-3f82-49e9-964a-7c8514e925e8@HIDDEN> (martin rudalics's
 message of "Sat, 30 Mar 2024 10:36:37 +0100")
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN> <86y1bffvya.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
 <86zfuq5jxj.fsf@HIDDEN>
 <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN>
 <86plvksv1e.fsf@HIDDEN>
 <578de52d-364b-4961-b4e2-7f91cdcaa0b9@HIDDEN>
 <86frwf8w4q.fsf@HIDDEN>
 <128b074a-b766-47eb-92ff-79814c900a06@HIDDEN>
 <86v85adzmd.fsf@HIDDEN>
 <a79ac121-cca7-4f41-a241-29f1f09aca6a@HIDDEN>
 <86le62vpew.fsf@HIDDEN>
 <b395cbc1-a8cb-457a-9942-63385eb74ff1@HIDDEN>
 <86sf0actmb.fsf@HIDDEN>
 <140cbfe8-c2b7-42cf-9500-82e2eab1278e@HIDDEN>
 <86msqhhvm4.fsf@HIDDEN>
 <a272da1d-3f82-49e9-964a-7c8514e925e8@HIDDEN>
Date: Sat, 30 Mar 2024 20:19:03 +0200
Message-ID: <86o7avd31o.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> +  "If this is non-nil, try to restore window points from their contexts.
>> +This will try to find the same position in the buffer where point was
>> +before switching away from this tab.  After selecting this tab,
>> +point will be moved to its previous place in the buffer even when
>> +the buffer was modified."
>
> "this window's point" instead of "point" and "position" instead of
> "place" would be more precise.

Ok:

(defcustom tab-bar-select-restore-context t
  "If this is non-nil, try to restore window points from their contexts.
This will try to find the same position in every window where point was
before switching away from this tab.  After selecting this tab,
point in every window will be moved to its previous position
in the buffer even when the buffer was modified."
  :type 'boolean
  :group 'tab-bar
  :version "30.1")




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 02 Apr 2024 17:23:02 +0000
Resent-Message-ID: <handler.33871.B33871.171207852717735 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 33871
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: martin rudalics <rudalics@HIDDEN>
Cc: 33871 <at> debbugs.gnu.org
Received: via spool by 33871-submit <at> debbugs.gnu.org id=B33871.171207852717735
          (code B ref 33871); Tue, 02 Apr 2024 17:23:02 +0000
Received: (at 33871) by debbugs.gnu.org; 2 Apr 2024 17:22:07 +0000
Received: from localhost ([127.0.0.1]:56136 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rrhpl-0004bo-Rz
	for submit <at> debbugs.gnu.org; Tue, 02 Apr 2024 13:22:06 -0400
Received: from relay1-d.mail.gandi.net ([217.70.183.193]:59881)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>)
 id 1rrhpj-0004aN-QA; Tue, 02 Apr 2024 13:22:04 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id B6915240005;
 Tue,  2 Apr 2024 17:21:52 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <86o7avd31o.fsf@HIDDEN> (Juri Linkov's message of "Sat, 
 30 Mar 2024 20:19:03 +0200")
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
 <86zfuq5jxj.fsf@HIDDEN>
 <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN>
 <86plvksv1e.fsf@HIDDEN>
 <578de52d-364b-4961-b4e2-7f91cdcaa0b9@HIDDEN>
 <86frwf8w4q.fsf@HIDDEN>
 <128b074a-b766-47eb-92ff-79814c900a06@HIDDEN>
 <86v85adzmd.fsf@HIDDEN>
 <a79ac121-cca7-4f41-a241-29f1f09aca6a@HIDDEN>
 <86le62vpew.fsf@HIDDEN>
 <b395cbc1-a8cb-457a-9942-63385eb74ff1@HIDDEN>
 <86sf0actmb.fsf@HIDDEN>
 <140cbfe8-c2b7-42cf-9500-82e2eab1278e@HIDDEN>
 <86msqhhvm4.fsf@HIDDEN>
 <a272da1d-3f82-49e9-964a-7c8514e925e8@HIDDEN>
 <86o7avd31o.fsf@HIDDEN>
Date: Tue, 02 Apr 2024 20:19:27 +0300
Message-ID: <864jcjel9s.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

close 33871 30.0.50
thanks

>> "this window's point" instead of "point" and "position" instead of
>> "place" would be more precise.
>
> Ok:
>
> (defcustom tab-bar-select-restore-context t
>   "If this is non-nil, try to restore window points from their contexts.
> This will try to find the same position in every window where point was
> before switching away from this tab.  After selecting this tab,
> point in every window will be moved to its previous position
> in the buffer even when the buffer was modified."
>   :type 'boolean
>   :group 'tab-bar
>   :version "30.1")

So pushed now and closed.  Thanks for the help!




Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 2 Apr 2024 17:22:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 02 13:22:07 2024
Received: from localhost ([127.0.0.1]:56138 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rrhpm-0004c0-Hz
	for submit <at> debbugs.gnu.org; Tue, 02 Apr 2024 13:22:07 -0400
Received: from relay1-d.mail.gandi.net ([217.70.183.193]:59881)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>)
 id 1rrhpj-0004aN-QA; Tue, 02 Apr 2024 13:22:04 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id B6915240005;
 Tue,  2 Apr 2024 17:21:52 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#33871: 27.0.50; Revert Dired window saved in window
 configuration
In-Reply-To: <86o7avd31o.fsf@HIDDEN> (Juri Linkov's message of "Sat, 
 30 Mar 2024 20:19:03 +0200")
Organization: LINKOV.NET
References: <87bm59mglk.fsf@HIDDEN>
 <bcaea0d2-37ca-47e5-8a1f-29f293bec2cf@HIDDEN>
 <8634skstio.fsf@HIDDEN>
 <f3f21397-875f-42f7-a8f4-6b356a802bc0@HIDDEN>
 <86msqr79n8.fsf@HIDDEN>
 <532c59dc-59af-4454-b926-2f80fe711fe9@HIDDEN>
 <86zfuq5jxj.fsf@HIDDEN>
 <5cf2b85e-9e24-4a7d-b175-ce140580df32@HIDDEN>
 <86plvksv1e.fsf@HIDDEN>
 <578de52d-364b-4961-b4e2-7f91cdcaa0b9@HIDDEN>
 <86frwf8w4q.fsf@HIDDEN>
 <128b074a-b766-47eb-92ff-79814c900a06@HIDDEN>
 <86v85adzmd.fsf@HIDDEN>
 <a79ac121-cca7-4f41-a241-29f1f09aca6a@HIDDEN>
 <86le62vpew.fsf@HIDDEN>
 <b395cbc1-a8cb-457a-9942-63385eb74ff1@HIDDEN>
 <86sf0actmb.fsf@HIDDEN>
 <140cbfe8-c2b7-42cf-9500-82e2eab1278e@HIDDEN>
 <86msqhhvm4.fsf@HIDDEN>
 <a272da1d-3f82-49e9-964a-7c8514e925e8@HIDDEN>
 <86o7avd31o.fsf@HIDDEN>
Date: Tue, 02 Apr 2024 20:19:27 +0300
Message-ID: <864jcjel9s.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: control
Cc: 33871 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

close 33871 30.0.50
thanks

>> "this window's point" instead of "point" and "position" instead of
>> "place" would be more precise.
>
> Ok:
>
> (defcustom tab-bar-select-restore-context t
>   "If this is non-nil, try to restore window points from their contexts.
> This will try to find the same position in every window where point was
> before switching away from this tab.  After selecting this tab,
> point in every window will be moved to its previous position
> in the buffer even when the buffer was modified."
>   :type 'boolean
>   :group 'tab-bar
>   :version "30.1")

So pushed now and closed.  Thanks for the help!





Last modified: Tue, 2 Apr 2024 17:30:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.