GNU bug report logs - #23621
25.1.50; Buffer in >1 window; winner-undo recover window point

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Tino Calancha <f92capac@HIDDEN>; dated Thu, 26 May 2016 15:35:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 23621) by debbugs.gnu.org; 1 Oct 2020 22:40:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 01 18:40:36 2020
Received: from localhost ([127.0.0.1]:38684 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kO7FY-0007og-Jo
	for submit <at> debbugs.gnu.org; Thu, 01 Oct 2020 18:40:36 -0400
Received: from mout.web.de ([212.227.15.4]:49187)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1kO7FT-0007oR-U2
 for 23621 <at> debbugs.gnu.org; Thu, 01 Oct 2020 18:40:31 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de;
 s=dbaedf251592; t=1601592021;
 bh=kv+J0337Qk81UC+VydPRA4ZJCbGndwP4EMxw7+Q8Imw=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To;
 b=Lbqgd75M6N0tC6pQkbQndEV5HEr28Oepqeu7CuLGgCvQz7IZ9RhNveISlmueiaZpN
 z+iBHNJ2F7RzJZ02tcbH1kjsuJI/9SE7mnMxKDv+kdpebXXsqMjd7l69Q5KFplTOVo
 8IlM8/q9b2P9i7wkDWX/8MuL8REetd7vxPnExJ7Q=
X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9
Received: from drachen.dragon ([94.218.220.78]) by smtp.web.de (mrweb001
 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LfzgJ-1kmBSx3FRD-00paVx; Fri, 02
 Oct 2020 00:40:20 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#23621: PATCH (25.1.50; Buffer in >1 window; winner-undo
 recover window point)
References: <alpine.LRH.2.20.1605270036130.16464@HIDDEN>
 <handler.23621.B.146427689721104.ack <at> debbugs.gnu.org>
 <alpine.LRH.2.20.1605270138500.16975@HIDDEN>
 <87eesdmw39.fsf@HIDDEN> <87lfgqu07v.fsf@HIDDEN>
Date: Fri, 02 Oct 2020 00:40:19 +0200
In-Reply-To: <87lfgqu07v.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Thu,
 01 Oct 2020 04:52:20 +0200")
Message-ID: <87a6x5o9ik.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:wD6lvCQSfvwQByUbQsc5fpDYlBsCN46JQIc/P7bKLxht6MZCqNL
 CC1qCfYYYDV5KxGFmiIvO1w+7OTepGIgqHEcmB5MY8/gcxaLezAoEvE1BnME0XoWvIGx7ji
 RUNccVCi8NP9peLgqNtyTcbQw9/yihgoZPR7r7zl1/FN3/qshHdFPpx0bdqcFJ1MhTc8zFd
 JnafYwQV81DwjvS1+/ddQ==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:8O/62ODaK30=:lQSBKtCsq3v/lFbWGPwjxq
 GZmqsNnCVhEG4XfAaa1PD+i4n/yMTtlCDgEzUdysXwzR/jC+DLjvP+1AgrWoXxYNwqDLV3Zd1
 2IWYIRKdbvmP4PPpGKpAJOPld5Z69vfkj3hNoPp0bOB93F7Pud34wA+iLBAmActWRu06qe13o
 AcgvAHZGq+WQ70qvIn9nYGQgfakWoRtSVc6x29vOHWdPNFvTRjDpIm9YaokV0+9Jbk4BDLM1W
 NXm9wh+nqFBjl0ORmz9JwmSr8N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 (/)
X-Debbugs-Envelope-To: 23621
Cc: Tino Calancha <f92capac@HIDDEN>, 23621 <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 (-)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> > If that is the case - we now have `compare-window-configurations' that
> > compares modulo value of point and such.  Wouldn't it be simpler to
> > teach delete-window e.a. to update the head window configuration in the
> > frame's entry of winner-ring-alist with the current version before a
> > window is deleted?
>
> Sorry, I missed this -- should 0454bfd3313c069ca395f02ab6f377a17ff44965
> be reverted?

I don't know much about this stuff.  Would be nice to hear from Tino.

Regards,

Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23621; Package emacs. Full text available.

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


Received: (at 23621) by debbugs.gnu.org; 1 Oct 2020 02:52:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 30 22:52:32 2020
Received: from localhost ([127.0.0.1]:33594 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kNohr-0003a7-SU
	for submit <at> debbugs.gnu.org; Wed, 30 Sep 2020 22:52:32 -0400
Received: from quimby.gnus.org ([95.216.78.240]:53496)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1kNohq-0003Zv-Ax
 for 23621 <at> debbugs.gnu.org; Wed, 30 Sep 2020 22:52:30 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 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=6Q1U0hzr0JL6/uHc4sRYPzMkaldKYI22ljopjmdwZXo=; b=kdwUPbwLcEbNvUjFIqCZ99c3JE
 RZ+/tZztm2SvYVsVnzGCWpT6KuL5bzelTEelU8PcHvLtMMHOHTIOYKbBnVk3wBX/o1jozoHPW8zkT
 wqzB0FFn39MJDOPzLYd3NCbcb4h/x3aX4S0C31M9ey4rCCkZyseu4IMrfBePoBQcaHKQ=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1kNohh-0001Bb-QO; Thu, 01 Oct 2020 04:52:24 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#23621: PATCH (25.1.50; Buffer in >1 window; winner-undo
 recover window point)
References: <alpine.LRH.2.20.1605270036130.16464@HIDDEN>
 <handler.23621.B.146427689721104.ack <at> debbugs.gnu.org>
 <alpine.LRH.2.20.1605270138500.16975@HIDDEN>
 <87eesdmw39.fsf@HIDDEN>
X-Now-Playing: Barbara Morgenstern's _Beide_: "Gleich is gleicher als gleich"
Date: Thu, 01 Oct 2020 04:52:20 +0200
In-Reply-To: <87eesdmw39.fsf@HIDDEN> (Michael Heerdegen's message of "Fri, 24
 Apr 2020 03:45:56 +0200")
Message-ID: <87lfgqu07v.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
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:  Michael Heerdegen <michael_heerdegen@HIDDEN> writes: > If
 that is the case - we now have `compare-window-configurations' that > compares
 modulo value of point and such. Wouldn't it be simpler to > teach
 delete-window e.a. to update the head window confi [...] 
 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: 0.0 (/)
X-Debbugs-Envelope-To: 23621
Cc: Tino Calancha <f92capac@HIDDEN>, 23621 <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.0 (-)

Michael Heerdegen <michael_heerdegen@HIDDEN> writes:

> If that is the case - we now have `compare-window-configurations' that
> compares modulo value of point and such.  Wouldn't it be simpler to
> teach delete-window e.a. to update the head window configuration in the
> frame's entry of winner-ring-alist with the current version before a
> window is deleted?

Sorry, I missed this -- should 0454bfd3313c069ca395f02ab6f377a17ff44965
be reverted?

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23621; Package emacs. Full text available.
Removed tag(s) patch and fixed. Request was from Michael Heerdegen <michael_heerdegen@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
bug No longer marked as fixed in versions 27.1 and reopened. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control <at> debbugs.gnu.org. Full text available.

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


Received: (at 23621) by debbugs.gnu.org; 24 Apr 2020 02:55:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 23 22:55:14 2020
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 1jRoUk-0000kW-AW
	for submit <at> debbugs.gnu.org; Thu, 23 Apr 2020 22:55:14 -0400
Received: from mout.web.de ([212.227.15.3]:47507)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1jRoUh-0000k9-Sb
 for 23621 <at> debbugs.gnu.org; Thu, 23 Apr 2020 22:55:13 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de;
 s=dbaedf251592; t=1587696904;
 bh=Hr+ANAUulAfm3SDdv81CHdgQGFKau89fqA2pySgrprQ=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:Date:References;
 b=HN8HV+6bLCt0lwBhqJJAkOgjx7M64T1FvtiCM07ZeyGLwann/rZyp+9BykwwnCVzm
 dMEwyvWtmCdSHICHAyYTh/ZIf17tFPKWNsHatLJHQUakdtVWR9N4HYfJupAXE4R0I9
 y7b2400uhamwM2XfxrmYNfxDH6UyIQ5Yf2tLCIFk=
X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9
Received: from drachen.dragon ([188.98.99.7]) by smtp.web.de (mrweb002
 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MQ5zf-1jVvER230N-005Li0; Fri, 24
 Apr 2020 04:55:04 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Tino Calancha <f92capac@HIDDEN>
Subject: Re: bug#23621: PATCH (25.1.50; Buffer in >1 window; winner-undo
 recover window point)
In-Reply-To: <alpine.LRH.2.20.1605270138500.16975@HIDDEN> (Tino
 Calancha's message of "Fri, 27 May 2016 01:40:47 +0900 (JST)")
Date: Fri, 24 Apr 2020 03:45:56 +0200
Lines: 14
References: <alpine.LRH.2.20.1605270036130.16464@HIDDEN>
 <handler.23621.B.146427689721104.ack <at> debbugs.gnu.org>
 <alpine.LRH.2.20.1605270138500.16975@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Message-ID: <87eesdmw39.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:QRnwPtpQhiVQYsCgNqVae6Y6mbOdGNbzKkk6riAAcYvw8k65/At
 j6OMhsFunJRnNIfMIaGMf6vZXCsQlKvrZTr18gAuu7MSb5w4T0yCz8OJ0KLdWEDUAOv4c95
 RthuBuGA4xHw5tgvCp0pBqHNkXNXSUuZ6y7R7dIXyTVDwrqZ7hHYKNXTUiltYVER5BMqxih
 USoGlQJU2jwlXU0P0M7Kw==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:cW/A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cbPZ11oBqoyY
 0nFa73jGkuqKT1Re6pQ66+lGpZreVpRVFBNgfeMysVHv+Y2rsle7pgh545igUf4S559rUxlzn
 hb3fCkcXsZ4Q6YyBiP5JXQebR+ZlfATiIR/xnJntHG/CmXh/IbUOWpNKSqSJ5UN7XYj3eHOsX
 5W1P5G8h+v9Vt0563AOj+JjsLTFiJ0iJ3fOH78E5k2ZiXfYDk8Hzie+o+dbCJWapUCGc4VCph
 dDepDhBpUKLLuwfGx
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 23621
Cc: 23621 <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 (-)

Tino Calancha <f92capac@HIDDEN> writes:

> Allow winner-undo to restore the buffer point from deleted
> windows (Bug#23621).
> * lisp/window.el (window--before-delete-windows): New defun.
> (delete-window, delete-other-windows): Use it.

Seems your patch works only partially because it actually changed
`minimize-window' instead of `delete-other-windows'.  Was it by mistake?

I also have a question: why do we need this at all?  Is it because the
window configuations saved are pushed when e.g. a window is split, but
only afterwards the user changes point etc, then a window is closed, and
when that's undone, without the patch, the originally saved window
configuration contains the initial, useless positions, because the
snapshot had actually been taken "too soon"?

If that is the case - we now have `compare-window-configurations' that
compares modulo value of point and such.  Wouldn't it be simpler to
teach delete-window e.a. to update the head window configuration in the
frame's entry of winner-ring-alist with the current version before a
window is deleted?


TIA,

Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23621; Package emacs. Full text available.
bug unarchived. Request was from Michael Heerdegen <michael_heerdegen@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
bug archived. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control <at> debbugs.gnu.org. Full text available.
bug marked as fixed in version 27.1, send any further explanations to 23621 <at> debbugs.gnu.org and Tino Calancha <f92capac@HIDDEN> Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 23621) by debbugs.gnu.org; 25 Jun 2019 13:44:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 25 09:44:10 2019
Received: from localhost ([127.0.0.1]:58975 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hflk2-00052S-12
	for submit <at> debbugs.gnu.org; Tue, 25 Jun 2019 09:44:10 -0400
Received: from quimby.gnus.org ([80.91.231.51]:49838)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1hfljy-00052G-51
 for 23621 <at> debbugs.gnu.org; Tue, 25 Jun 2019 09:44:08 -0400
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories)
 by quimby.gnus.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89)
 (envelope-from <larsi@HIDDEN>)
 id 1hflju-0000SU-AE; Tue, 25 Jun 2019 15:44:04 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Tino Calancha <f92capac@HIDDEN>
Subject: Re: bug#23621: PATCH (25.1.50; Buffer in >1 window;
 winner-undo recover window point)
References: <alpine.LRH.2.20.1605270036130.16464@HIDDEN>
 <handler.23621.B.146427689721104.ack <at> debbugs.gnu.org>
 <alpine.LRH.2.20.1605270138500.16975@HIDDEN>
Date: Tue, 25 Jun 2019 15:44:02 +0200
In-Reply-To: <alpine.LRH.2.20.1605270138500.16975@HIDDEN> (Tino
 Calancha's message of "Fri, 27 May 2016 01:40:47 +0900 (JST)")
Message-ID: <m3woh993vh.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
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: Tino Calancha <f92capac@HIDDEN> writes: > Allow users
 editing
 same buffer in diferent windows to restore > the window point with
 `winner-undo'.
 The patch looked OK to me, but I'm not a winner user. I've applied the patch
 and tested superficially, but if this commit leads to problems, please revert
 the patch and reopen this bug report. 
 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: 0.0 (/)
X-Debbugs-Envelope-To: 23621
Cc: 23621 <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.0 (-)

Tino Calancha <f92capac@HIDDEN> writes:

> Allow users editing same buffer in diferent windows to restore
> the window point with `winner-undo'.

The patch looked OK to me, but I'm not a winner user.  I've applied the
patch and tested superficially, but if this commit leads to problems,
please revert the patch and reopen this bug report.

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23621; Package emacs. Full text available.

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


Received: (at 23621) by debbugs.gnu.org; 26 May 2016 16:37:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 26 12:37:39 2016
Received: from localhost ([127.0.0.1]:40753 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1b5yHy-000745-TI
	for submit <at> debbugs.gnu.org; Thu, 26 May 2016 12:37:39 -0400
Received: from calancha-ilc.kek.jp ([130.87.234.234]:49063)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <f92capac@HIDDEN>) id 1b5yHw-00073p-C8
 for 23621 <at> debbugs.gnu.org; Thu, 26 May 2016 12:37:37 -0400
Received: by calancha-ilc.kek.jp (Postfix, from userid 500)
 id 01936726B; Fri, 27 May 2016 01:40:47 +0900 (JST)
Received: from localhost (localhost [127.0.0.1])
 by calancha-ilc.kek.jp (Postfix) with ESMTP id DF944549A;
 Fri, 27 May 2016 01:40:47 +0900 (JST)
Date: Fri, 27 May 2016 01:40:47 +0900 (JST)
From: Tino Calancha <f92capac@HIDDEN>
X-X-Sender: calancha@HIDDEN
To: 23621 <at> debbugs.gnu.org
Subject: Re: bug#23621: PATCH (25.1.50; Buffer in >1 window; winner-undo
 recover window point)
In-Reply-To: <handler.23621.B.146427689721104.ack <at> debbugs.gnu.org>
Message-ID: <alpine.LRH.2.20.1605270138500.16975@HIDDEN>
References: <alpine.LRH.2.20.1605270036130.16464@HIDDEN>
 <handler.23621.B.146427689721104.ack <at> debbugs.gnu.org>
User-Agent: Alpine 2.20 (LRH 67 2015-01-07)
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset=US-ASCII
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 23621
Cc: Tino Calancha <f92capac@HIDDEN>
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 (+)


Allow users editing same buffer in diferent windows to restore
the window point with `winner-undo'.

This report is related with Bug#4041: the behaviour of 
`winner-undo' just change if an user has set the option 
`switch-to-buffer-preserve-window-point' non-nil.

Following patch restore the buffer point from deleted windows in the
2 previous examples (if `switch-to-buffer-preserve-window-point' evaluates
non-nil).

From 37c088a3cc0ae303dda570e4d93195131f6a9892 Mon Sep 17 00:00:00 2001
From: Tino Calancha <f92capac@HIDDEN>
Date: Fri, 27 May 2016 01:27:18 +0900
Subject: [PATCH] Editing same buffer in >1 window; winner-undo enhancement

Allow winner-undo to restore the buffer point from deleted
windows (Bug#23621).
* lisp/window.el (window--before-delete-windows): New defun.
(delete-window, delete-other-windows): Use it.
* lisp/winner.el (winner-set): Use marker in 'window-prev-buffers'
when available and different than the value returned by 'winner-get-point'.
---
  lisp/window.el | 39 +++++++++++++++++++++++++++++++++++++++
  lisp/winner.el | 13 +++++++++++--
  2 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/lisp/window.el b/lisp/window.el
index bd5275b..7a7f9ac 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -3775,6 +3775,41 @@ window--in-subtree-p
  		(throw 'done t)
  	      (setq parent (window-parent parent))))))))

+;; This function is called by `delete-window' and
+;; `delete-other-windows' when `switch-to-buffer-preserve-window-point'
+;; evaluates non-nil: it allows `winner-undo' to restore the
+;; buffer point from deleted windows (Bug#23621).
+(defun window--before-delete-windows (&optional window)
+  "Update `window-prev-buffers' before delete a window.
+Optional arg WINDOW, if non-nil, update WINDOW-START and POS
+in `window-prev-buffers' for all windows displaying same
+buffer as WINDOW.  Otherwise, update `window-prev-buffers' for
+all windows.
+
+The new values for WINDOW-START and POS are those
+returned by `window-start' and `window-point' respectively.
+
+This function is called only if `switch-to-buffer-preserve-window-point'
+evaluates non-nil."
+  (dolist (win (window-list))
+    (let* ((buf   (window-buffer (or window win)))
+           (start (window-start win))
+           (pos   (window-point win))
+           (entry (assq buf (window-prev-buffers win))))
+      (cond (entry
+             (let ((marker (nth 2 entry)))
+               (unless (= pos marker)
+                 (set-marker (nth 1 entry) start buf)
+                 (set-marker marker pos buf))))
+            (t
+             (let ((prev-buf (window-prev-buffers win))
+                   (start-m  (make-marker))
+                   (pos-m    (make-marker)))
+               (set-marker start-m start buf)
+               (set-marker pos-m pos buf)
+               (push (list buf start-m pos-m) prev-buf)
+               (set-window-prev-buffers win prev-buf)))))))
+
  (defun delete-window (&optional window)
    "Delete WINDOW.
  WINDOW must be a valid window and defaults to the selected one.
@@ -3793,6 +3828,8 @@ delete-window
  its frame, the last non-side window, or part of an atomic window
  that is its frame's root window."
    (interactive)
+  (when switch-to-buffer-preserve-window-point
+    (window--before-delete-windows window))
    (setq window (window-normalize-window window))
    (let* ((frame (window-frame window))
  	 (function (window-parameter window 'delete-window))
@@ -3875,6 +3912,8 @@ delete-other-windows
  on the frame.  Side windows are not deleted.  If WINDOW is a side
  window signal an error."
    (interactive)
+  (when switch-to-buffer-preserve-window-point
+    (window--before-delete-windows))
    (setq window (window-normalize-window window))
    (let* ((frame (window-frame window))
  	 (function (window-parameter window 'delete-other-windows))
diff --git a/lisp/winner.el b/lisp/winner.el
index 9a6f5d5..2a213ab 100644
--- a/lisp/winner.el
+++ b/lisp/winner.el
@@ -297,8 +297,17 @@ winner-set
        ;; Restore points
        (dolist (win (winner-sorted-window-list))
          (unless (and (pop alive)
-                     (setf (window-point win)
-                           (winner-get-point (window-buffer win) win))
+                     (let* ((buf   (window-buffer win))
+                            (pos   (winner-get-point (window-buffer win) win))
+                            (entry (assq buf (window-prev-buffers win))))
+                       ;; Try to restore point of buffer in the selected
+                       ;; window (Bug#23621).
+                       (let ((marker (nth 2 entry)))
+                         (when (and switch-to-buffer-preserve-window-point
+                                    marker
+                                    (not (= marker pos)))
+                           (setq pos marker))
+                         (setf (window-point win) pos)))
                       (not (member (buffer-name (window-buffer win))
                                    winner-boring-buffers)))
            (push win xwins)))            ; delete this window
-- 
2.8.1






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23621; Package emacs. Full text available.

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


Received: (at submit) by debbugs.gnu.org; 26 May 2016 15:34:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 26 11:34:57 2016
Received: from localhost ([127.0.0.1]:40670 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1b5xJJ-0005UJ-8L
	for submit <at> debbugs.gnu.org; Thu, 26 May 2016 11:34:57 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45015)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <f92capac@HIDDEN>) id 1b5xJI-0005U7-51
 for submit <at> debbugs.gnu.org; Thu, 26 May 2016 11:34:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <f92capac@HIDDEN>) id 1b5xJC-0007NH-00
 for submit <at> debbugs.gnu.org; Thu, 26 May 2016 11:34:50 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:39870)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <f92capac@HIDDEN>) id 1b5xJB-0007N3-Sx
 for submit <at> debbugs.gnu.org; Thu, 26 May 2016 11:34:49 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:35962)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <f92capac@HIDDEN>) id 1b5xJ9-0007ej-PE
 for bug-gnu-emacs@HIDDEN; Thu, 26 May 2016 11:34:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <f92capac@HIDDEN>) id 1b5xJ5-0007KG-It
 for bug-gnu-emacs@HIDDEN; Thu, 26 May 2016 11:34:47 -0400
Received: from calancha-ilc.kek.jp ([130.87.234.234]:35692)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <f92capac@HIDDEN>) id 1b5xJ5-0007IS-7d
 for bug-gnu-emacs@HIDDEN; Thu, 26 May 2016 11:34:43 -0400
Received: by calancha-ilc.kek.jp (Postfix, from userid 500)
 id 7707D726B; Fri, 27 May 2016 00:37:58 +0900 (JST)
Received: from localhost (localhost [127.0.0.1])
 by calancha-ilc.kek.jp (Postfix) with ESMTP id 086F0421C
 for <bug-gnu-emacs@HIDDEN>; Fri, 27 May 2016 00:37:58 +0900 (JST)
Date: Fri, 27 May 2016 00:37:57 +0900 (JST)
From: Tino Calancha <f92capac@HIDDEN>
X-X-Sender: calancha@HIDDEN
To: bug-gnu-emacs@HIDDEN
Subject: 25.1.50; Buffer in >1 window; winner-undo recover window point
Message-ID: <alpine.LRH.2.20.1605270036130.16464@HIDDEN>
User-Agent: Alpine 2.20 (LRH 67 2015-01-07)
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset=US-ASCII
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
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: -4.0 (----)


For users editing same buffer in differente windows
it may be useful if `winner-undo' could restaure
also the window point from each window.

;; visit same file in 2 windows
./emacs -Q -mm -eval '(progn
                         (find-file-read-only "../src/window.c")
                         (winner-mode 1)
                         (goto-char 1000)
                         (split-window-right)
                         (other-window 1)
                         (goto-char 30500))'

M-! ls ~ RET ; C-x 0 ;; C-x 1 ;;; C-x b
C-c <left>

;; `window-point' return 30500 value for both windows.


;; You may want to preserve > 2 buffr positions.
;; Following example visits different positions of the same
;; buffer in 4 windows.
./emacs -Q -mm -eval '(progn
                         (find-file-read-only "../src/window.c")
                         (winner-mode 1)
                         (goto-char 1000)
                         (split-window-right)
                         (windmove-right 1)
                         (goto-char 30500)

                         (split-window-below)
                         (windmove-down 1)
                         (goto-char 50000)

                         (windmove-left 1)
                         (split-window-below)
                         (windmove-down 1)
                         (goto-char 250000))'

;; As before `window-point' is not preserved for all windows.


In GNU Emacs 25.1.50.3 (x86_64-pc-linux-gnu, GTK+ Version 2.24.30)
  of 2016-05-26 built on calancha-pc
Repository revision: 16be3e90545972dec16014253a843229d5bdf388




Acknowledgement sent to Tino Calancha <f92capac@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#23621; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 1 Oct 2020 22:45:02 UTC

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