From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.bugs Subject: bug#23785: Emacs 25: "Undo" overdoes things. Date: Fri, 17 Jun 2016 22:23:51 +0100 Message-ID: <877fdny0ew.fsf@russet.org.uk> References: <20160617150245.GB3316@acm.fritz.box> <83r3bvbuu1.fsf@gnu.org> <20160617174535.GD3316@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1466198726 12077 80.91.229.3 (17 Jun 2016 21:25:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Jun 2016 21:25:26 +0000 (UTC) Cc: 23785@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 17 23:25:13 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 1bE1GK-0002YY-TL for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Jun 2016 23:25:13 +0200 Original-Received: from localhost ([::1]:60360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE1GJ-0005GK-JG for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Jun 2016 17:25:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE1GE-0005Eo-1t for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 17:25:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bE1GA-0001gt-83 for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 17:25:04 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE1GA-0001gp-4E for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 17:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bE1G9-0008Qh-Ta for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 17:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: phillip.lord@russet.org.uk (Phillip Lord) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Jun 2016 21:25:01 +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.146619864132316 (code B ref 23785); Fri, 17 Jun 2016 21:25:01 +0000 Original-Received: (at 23785) by debbugs.gnu.org; 17 Jun 2016 21:24:01 +0000 Original-Received: from localhost ([127.0.0.1]:44552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bE1FB-0008P7-9s for submit@debbugs.gnu.org; Fri, 17 Jun 2016 17:24:01 -0400 Original-Received: from cloud103.planethippo.com ([31.216.48.48]:47324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bE1F9-0008Oq-BR for 23785@debbugs.gnu.org; Fri, 17 Jun 2016 17:23:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=russet.org.uk; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=5+CCJovaI/p3QAAYYVRxFcmdyzLnyRboEy7DvGYT/cs=; b=kfJ8pj9bOKKHKOs2YhpmvZiE2q LOo+VWgTH82iLV4Voz/lsAWEaOAvYY2dg2GoSFP6cPg/s/E5PPrZjU7faNQ46FUcc/HrPKmv2VJlW RfCAgmDdK5KX/na1GD+SQ6BLt3DRG7NYbYQGb2iQHru6QePmNLbBZbiQA9LkVsEmWRU8gwx8YPIsc vOIL3TJW7JUkp1qkSUxziZ44BGI4xIhn0G6lTy1HpewPB44W6u9l/BqFy9YrKyIvX9xryBy27oBK5 AvG7dcJhJiT+yqHoQAxNlhFSy5WmDmgcfYlQcCmdbIMifup/izMdWsHcsE4RbIIJCwBuv2llMZVIb UAyfdEMw==; Original-Received: from cpc1-benw10-2-0-cust373.gate.cable.virginm.net ([77.98.219.118]:50418 helo=russet.org.uk) by cloud103.planethippo.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86_1) (envelope-from ) id 1bE1F3-001XCT-0N; Fri, 17 Jun 2016 22:23:53 +0100 In-Reply-To: <20160617174535.GD3316@acm.fritz.box> (Alan Mackenzie's message of "Fri, 17 Jun 2016 17:45:35 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud103.planethippo.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - russet.org.uk X-Get-Message-Sender-Via: cloud103.planethippo.com: authenticated_id: phillip.lord@russet.org.uk X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@russet.org.uk 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:119697 Archived-At: Alan Mackenzie writes: > Hello, Eli. > > On Fri, Jun 17, 2016 at 08:15:18PM +0300, Eli Zaretskii wrote: >> > Date: Fri, 17 Jun 2016 15:02:45 +0000 >> > From: Alan Mackenzie > >> > Summary: `undo' is broken in Emacs 25. > >> > In GNU Emacs 25.0.94.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.7) >> > of 2016-06-07 built on acm >> > Repository revision: 9d5ccebeba0506f7280662630f0ee85a52c8a327 >> > Configured using: >> > 'configure --with-tiff=3Dno --with-gif=3Dno --with-gpm' > >> > 1. emacs -Q >> > 2. C-x C-f decls-6.cc ; file is attached. >> > 3. Move point to BOL 17. >> > 4. C-o, and insert the line "Type var =3D init;". Call this line 16= =C2=BD. >> > 5. M-x revert-buffer. >> > 6. Move point to "[" on L16, and use C-M-k to delete "[3 * peq]". >> > 7. C-_. This restores "[3 * peq]" (correctly) but also reinserts line >> > 16=C2=BD (which is a bug). > >> Why does this minor issue deserve to declare 'undo' "broken"? Looks >> like an exaggeration to me. > > I don't think it's all that minor an issue. `undo' can no longer be > depended upon to restore a buffer to its unchanged state. > > I've suffered several similar annoyances with `undo' in the emacs-25 > branch. If you report them, then I will look at them, and I would appreciate if you do report them. I changed undo in a way that *was* supposed to change its semantics, and this may have had negative side effects. Or my changes may have caused unexpected changes in semantics that I did not intend. > Each buffer changing command is meant to have its own undo boundary > (with the exception of self-insert-command and the single character > deleting command). The problem in this case seems to be specific to revert-buffer. A much simpler test case is as follows 1) Open a file with a single line in it 2) Add a new line at the start 3) M-x revert-buffer Look at buffer-undo-list *** Before undo changes (nil ("\n" . -1) (# . -1) (# . -1) (# . -1) nil (1 . 2) (t 22372 26717 127527 392000)) *** After undo changes (("\n" . -1) (# . -1) (# . -1) nil (1 . 2) (t 22372 26717 127527 392000)) So, the issue seems to be specific to M-x revert-buffer. After my changes, the list no longer has a undo-boundary as its first element. Got to be honest, I am surprised that M-x revert-buffer maintains the undo-list; I'd have expected it to blitz the whole list, but it doesn't. No idea why, although I suspect that it's the same issue Stefan found with viper -- undo-boundary no longer gets called after all commands only those that change the buffer. I will investigate. Phil