From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#23785: Emacs 25: "Undo" overdoes things. Date: Sat, 18 Jun 2016 10:54:56 +0300 Message-ID: <83eg7vaq3z.fsf@gnu.org> References: <20160617150245.GB3316@acm.fritz.box> <83r3bvbuu1.fsf@gnu.org> <20160617174535.GD3316@acm.fritz.box> <83oa6zbmvd.fsf@gnu.org> <87ziqjwkrb.fsf@russet.org.uk> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1466236527 28159 80.91.229.3 (18 Jun 2016 07:55:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Jun 2016 07:55:27 +0000 (UTC) Cc: acm@muc.de, 23785@debbugs.gnu.org, monnier@iro.umontreal.ca To: phillip.lord@russet.org.uk (Phillip Lord) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 18 09:55:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bEB62-0004Ej-Rz for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Jun 2016 09:55:15 +0200 Original-Received: from localhost ([::1]:33512 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEB62-0008Eq-0S for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Jun 2016 03:55:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEB5u-0008Bm-Sb for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 03:55:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEB5q-0004PG-MA for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 03:55:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEB5q-0004PC-Ig for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 03:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bEB5q-0007t2-DQ for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 03:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Jun 2016 07:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23785 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23785-submit@debbugs.gnu.org id=B23785.146623644530247 (code B ref 23785); Sat, 18 Jun 2016 07:55:02 +0000 Original-Received: (at 23785) by debbugs.gnu.org; 18 Jun 2016 07:54:05 +0000 Original-Received: from localhost ([127.0.0.1]:44697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bEB4u-0007rn-RO for submit@debbugs.gnu.org; Sat, 18 Jun 2016 03:54:05 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52493) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bEB4t-0007rK-KM for 23785@debbugs.gnu.org; Sat, 18 Jun 2016 03:54:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEB4l-0004Lh-DJ for 23785@debbugs.gnu.org; Sat, 18 Jun 2016 03:53:58 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53560) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEB4l-0004Ld-9o; Sat, 18 Jun 2016 03:53:55 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1055 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bEB4j-0006rc-Bq; Sat, 18 Jun 2016 03:53:53 -0400 In-reply-to: <87ziqjwkrb.fsf@russet.org.uk> (phillip.lord@russet.org.uk) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:119716 Archived-At: > From: phillip.lord@russet.org.uk (Phillip Lord) > Cc: Alan Mackenzie , 23785@debbugs.gnu.org > Date: Fri, 17 Jun 2016 22:47:20 +0100 > > The following patch addresses the issue in my hands. I'd welcome > confirmation. > > Stefan what do you think? You suggested something like this for > Bug#22295 also. I think that the problem is the same; if I read > insert-file-contents correctly, it disables collection of undo > information. I may well be reading it wrong though. > > Given that this has turned up in two places now, it may be a wider > problem, and the more general solution might be the better one. It might > also invalidate the necessity for 12e009e52, but I haven't tested that > yet. > > Alternatively, revert-buffer could just force undo-boundary. > > >From 2ab1f314ad6fe0e68420cc510445495467d82b8f Mon Sep 17 00:00:00 2001 > From: Phillip Lord > Date: Fri, 17 Jun 2016 22:34:50 +0100 > Subject: [PATCH] Fix missing undo-boundary after revert-buffer > > * lisp/simple.el (undo-auto--boundaries): Ensure an undo-boundary after > every command whether it (apparently) changes the buffer or not. > > Addresses Bug#23785 > --- > lisp/simple.el | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/lisp/simple.el b/lisp/simple.el > index b66827d..3110430 100644 > --- a/lisp/simple.el > +++ b/lisp/simple.el > @@ -2875,6 +2875,10 @@ undo-auto--boundaries > "Check recently changed buffers and add a boundary if necessary. > REASON describes the reason that the boundary is being added; see > `undo-last-boundary' for more information." > + ;; (Bug #23785) All commands should ensure that there is an undo > + ;; boundary whether they have changed the current buffer or not. > + (when (eq cause 'command) > + (add-to-list 'undo-auto--undoably-changed-buffers (current-buffer))) > (dolist (b undo-auto--undoably-changed-buffers) > (when (buffer-live-p b) > (with-current-buffer b I'd indeed suggest to have on emacs-25 a change that only affects revert-buffer, and have the above on master. It sounds too scary to make a change that affects all commands this late in the pretest. Thanks.