GNU bug report logs - #23785
Emacs 25: "Undo" overdoes things.

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; Reported by: Alan Mackenzie <acm@HIDDEN>; dated Fri, 17 Jun 2016 15:03:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 23785) by debbugs.gnu.org; 20 Jun 2016 15:35:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 20 11:35:31 2016
Received: from localhost ([127.0.0.1]:47882 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bF1EZ-0000qf-HB
	for submit <at> debbugs.gnu.org; Mon, 20 Jun 2016 11:35:31 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55445)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1bF1EX-0000qS-L8
 for 23785 <at> debbugs.gnu.org; Mon, 20 Jun 2016 11:35:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1bF1EO-0001Pw-6P
 for 23785 <at> debbugs.gnu.org; Mon, 20 Jun 2016 11:35:24 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48567)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1bF1EO-0001Oy-35; Mon, 20 Jun 2016 11:35:20 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3606
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1bF1EG-0006VZ-Vo; Mon, 20 Jun 2016 11:35:13 -0400
Date: Mon, 20 Jun 2016 18:34:18 +0300
Message-Id: <83wplj7u2t.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: phillip.lord@HIDDEN (Phillip Lord)
In-reply-to: <87vb13ewc8.fsf@HIDDEN> (phillip.lord@HIDDEN)
Subject: Re: bug#23785: Emacs 25: 'Undo' overdoes things.
References: <20160617150245.GB3316@HIDDEN> <83r3bvbuu1.fsf@HIDDEN>
 <20160617174535.GD3316@HIDDEN> <83oa6zbmvd.fsf@HIDDEN>
 <87ziqjwkrb.fsf@HIDDEN> <83eg7vaq3z.fsf@HIDDEN>
 <jwvmvmi5ohk.fsf-monnier+emacsbugs@HIDDEN> <83bn2y9v80.fsf@HIDDEN>
 <jwv7fdm5l8g.fsf-monnier+emacsbugs@HIDDEN>
 <adeb26a2b322f2e73c614048f518ab98.squirrel@HIDDEN>
 <87vb13ewc8.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.4 (------)
X-Debbugs-Envelope-To: 23785
Cc: acm@HIDDEN, 23785 <at> debbugs.gnu.org, monnier@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>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.4 (------)

> From: phillip.lord@HIDDEN (Phillip Lord)
> Cc: "Eli Zaretskii" <eliz@HIDDEN>,  acm@HIDDEN,  23785 <at> debbugs.gnu.org
> Date: Mon, 20 Jun 2016 16:03:35 +0100
> 
> My suggestion: this patch goes to Emacs-25.

What patch?




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

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


Received: (at 23785) by debbugs.gnu.org; 20 Jun 2016 15:04:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 20 11:04:10 2016
Received: from localhost ([127.0.0.1]:47845 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bF0kE-00005s-2y
	for submit <at> debbugs.gnu.org; Mon, 20 Jun 2016 11:04:10 -0400
Received: from cloud103.planethippo.com ([31.216.48.48]:39695)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <phillip.lord@HIDDEN>) id 1bF0kC-00005f-Er
 for 23785 <at> debbugs.gnu.org; Mon, 20 Jun 2016 11:04:08 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=russet.org.uk; s=default; h=Content-Type:MIME-Version:References:Message-ID
 :Date:In-Reply-To:Subject:Cc:To:From;
 bh=dt57BGTyY1d8t8c2rcKnWrjmEove9tsNCj42mXV+VHY=; b=McYSmCzrIzMpoAJhn9hmCt1PKa
 OkwnAiTxX05XXTETiz9sjG5sfeUnvkpO7ZJ39NgAIGwbLF8aXt99F7Jsq+pkfoxw157rDnnEeFg7a
 OdqE4eBwoC5axbbjVYtObGlbgKANYmmCH17Btplnex0c7IEf53sgRA8UAzlMmtaQ2TX7NVP5KFcDv
 dxDw7adau/shG7RF/2pL1ckcpFrymLw5YL31I3A7L3Xb2dG/1h32Z/vCw4euz82NcsgmMLUXWVBE6
 88n9XpG/iTzYQ18EELYeSGX70O48zLZELVhzUeqA2YpnNJq/V6ZJIAVkt5yERwQH7jSTP8rU40Tka
 brn6OP6w==;
Received: from janus-nat-128-240-225-60.ncl.ac.uk ([128.240.225.60]:32765
 helo=russet.org.uk)
 by cloud103.planethippo.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128)
 (Exim 4.86_1) (envelope-from <phillip.lord@HIDDEN>)
 id 1bF0k6-003ID7-7M; Mon, 20 Jun 2016 16:04:02 +0100
From: phillip.lord@HIDDEN (Phillip Lord)
To: "Stefan Monnier" <monnier@HIDDEN>
Subject: Re: bug#23785: Emacs 25: 'Undo' overdoes things.
In-Reply-To: <adeb26a2b322f2e73c614048f518ab98.squirrel@HIDDEN>
 (Phillip Lord's message of "Sun, 19 Jun 2016 23:45:44 +0100")
Date: Mon, 20 Jun 2016 16:03:35 +0100
Message-ID: <87vb13ewc8.fsf@HIDDEN>
References: <20160617150245.GB3316@HIDDEN> <83r3bvbuu1.fsf@HIDDEN>
 <20160617174535.GD3316@HIDDEN> <83oa6zbmvd.fsf@HIDDEN>
 <87ziqjwkrb.fsf@HIDDEN> <83eg7vaq3z.fsf@HIDDEN>
 <jwvmvmi5ohk.fsf-monnier+emacsbugs@HIDDEN> <83bn2y9v80.fsf@HIDDEN>
 <jwv7fdm5l8g.fsf-monnier+emacsbugs@HIDDEN>
 <adeb26a2b322f2e73c614048f518ab98.squirrel@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
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@HIDDEN
X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 23785
Cc: acm@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 23785 <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: 0.0 (/)

"Phillip Lord" <phillip.lord@HIDDEN> writes:

> On Sat, June 18, 2016 8:52 pm, Stefan Monnier wrote:
>>> My concern is not with the behavior the proposed change intends to get
>>> us, the concern is with the unintended consequences of the change.  At
>>> this late stage, I'd like to keep the risk of unintended consequences to
>>> the minimum, unless we want this change so badly we agree to extend the
>>> pretesting by another month or two.
>>
>> Yes, that's the other side of the coin, indeed.
>
> So many possibilities!


So, final patch possibility -- this one, I think directly fixes the
problem -- it ensures that the changes in the buffer result in an
undoable change.

It's probably less efficient (cause the undo-list will be created, then
dumped), but is the most minimal change.

My suggestion: this patch goes to Emacs-25. And the previous patch
(which automatically adds an undo boundary to current-buffer regardless
of changes), goes to master.

Phil




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

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


Received: (at 23785) by debbugs.gnu.org; 20 Jun 2016 14:04:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 20 10:04:13 2016
Received: from localhost ([127.0.0.1]:47793 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bEzoD-0005WL-JJ
	for submit <at> debbugs.gnu.org; Mon, 20 Jun 2016 10:04:13 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.181]:46684)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1bEzoA-0005W4-36
 for 23785 <at> debbugs.gnu.org; Mon, 20 Jun 2016 10:04:11 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0A+FgA731xV/0P0SC1cgxCEAoVVwwsEAgKBPD0QAQEBAQEBAYEKQQWDXQEBAwFWIwULCzQSFBgNiFsIzyMBAQEBBgEBAQEeizqFBQeELQWfF5IUg1kjhBQigngBAQE
X-IPAS-Result: A0A+FgA731xV/0P0SC1cgxCEAoVVwwsEAgKBPD0QAQEBAQEBAYEKQQWDXQEBAwFWIwULCzQSFBgNiFsIzyMBAQEBBgEBAQEeizqFBQeELQWfF5IUg1kjhBQigngBAQE
X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="244719247"
Received: from 45-72-244-67.cpe.teksavvy.com (HELO pastel.home)
 ([45.72.244.67])
 by ironport2-out.teksavvy.com with ESMTP; 20 Jun 2016 10:04:01 -0400
Received: by pastel.home (Postfix, from userid 20848)
 id 485ED64C54; Mon, 20 Jun 2016 10:04:01 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: phillip.lord@HIDDEN (Phillip Lord)
Subject: Re: bug#23785: Emacs 25: 'Undo' overdoes things.
Message-ID: <jwvlh20yn66.fsf-monnier+bug#23785@HIDDEN>
References: <20160617150245.GB3316@HIDDEN> <83r3bvbuu1.fsf@HIDDEN>
 <20160617174535.GD3316@HIDDEN> <83oa6zbmvd.fsf@HIDDEN>
 <87ziqjwkrb.fsf@HIDDEN> <83eg7vaq3z.fsf@HIDDEN>
 <jwvmvmi5ohk.fsf-monnier+emacsbugs@HIDDEN> <83bn2y9v80.fsf@HIDDEN>
 <jwv7fdm5l8g.fsf-monnier+emacsbugs@HIDDEN>
 <adeb26a2b322f2e73c614048f518ab98.squirrel@HIDDEN>
 <jwvh9coad9g.fsf-monnier+emacsbugs@HIDDEN>
 <874m8oc9hc.fsf@HIDDEN>
Date: Mon, 20 Jun 2016 10:04:01 -0400
In-Reply-To: <874m8oc9hc.fsf@HIDDEN> (Phillip Lord's message of "Mon,
 20 Jun 2016 13:47:59 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 1.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:  > I don't understand why you say this. AFAICT, the problem
 is that the > buffer-undo-list doesn't have a nil after the command has
 happened.
 Hmm... I thought I had seen a trace showing that there was a nil before the
 revert-buffer that then disappeared. But it looks like I misremember. Sorry.
 [...] Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/, low
 trust [206.248.154.181 listed in list.dnswl.org]
 1.0 FSL_HELO_HOME          No description available.
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [206.248.154.181 listed in wl.mailspike.net]
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
X-Debbugs-Envelope-To: 23785
Cc: acm@HIDDEN, 23785 <at> debbugs.gnu.org, Eli Zaretskii <eliz@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.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:  > I don't understand why you say this. AFAICT, the problem
    is that the > buffer-undo-list doesn't have a nil after the command has happened.
    Hmm... I thought I had seen a trace showing that there was a nil before the
    revert-buffer that then disappeared. But it looks like I misremember. Sorry.
    [...] 
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/, low
                             trust
                             [206.248.154.181 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [206.248.154.181 listed in wl.mailspike.net]
  1.0 FSL_HELO_HOME          No description available.
  1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders

> I don't understand why you say this. AFAICT, the problem is that the
> buffer-undo-list doesn't have a nil after the command has happened.

Hmm... I thought I had seen a trace showing that there was a nil before
the revert-buffer that then disappeared.  But it looks like
I misremember.  Sorry.

> I think that it does -- it calls "insert_from_buffer" which then calls
> "prepare_to_modify_buffer".
> I *think* what is happening is that prepare_to_modify_buffer is being
> called when buffer-undo-list is specbound to t -- hence the change does
> not register as undoable change.

That would be a good explanation, indeed.  So I guess your patch is the
right fix.  Thank you.


        Stefan




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

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


Received: (at 23785) by debbugs.gnu.org; 20 Jun 2016 12:48:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 20 08:48:07 2016
Received: from localhost ([127.0.0.1]:47187 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bEycZ-0003aF-KK
	for submit <at> debbugs.gnu.org; Mon, 20 Jun 2016 08:48:07 -0400
Received: from cloud103.planethippo.com ([31.216.48.48]:33797)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <phillip.lord@HIDDEN>) id 1bEycY-0003Zl-13
 for 23785 <at> debbugs.gnu.org; Mon, 20 Jun 2016 08:48:06 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=russet.org.uk; s=default; h=Content-Type:MIME-Version:Message-ID:
 In-Reply-To:Date:References:Subject:Cc:To:From;
 bh=2lpJY7BkuhMRZOAzPC1bULjuUZEgo1R24fX0pBd/7ng=; b=bi4du3ZciAwlAM1F/kclh83caY
 qy+3VYpE9Ataww1tY/zpX3mPqTvUdoYEaSGeCo+3rxBVvKy04RM0QATmOYIbrsJyqZt63G/+VGhom
 gDuMu3j+jZD5C166EwDcM1C7O2m4AxmOz1aHMHPEp0E6QkB5ETWTYK7cpZwBxwUvSJ1/W1JtC4Lnb
 iAxXVFgssoRCkKgmtU9xNpBoPRdINWbPW/+2IH0dvyn09W6SW8PeQyBPt2U9QOHTp9vCAtH5dFDnE
 8b+BEqElF/6Xa21S3IVUbltTtcNOUvgM4FCFRgoFbAkvcMEo2EDAagzBOl6/7/G5eJ7PgcWLfMHQf
 eoNrTHvA==;
Received: from janus-nat-128-240-225-83.ncl.ac.uk ([128.240.225.83]:32800
 helo=russet.org.uk) by cloud103.planethippo.com with esmtpsa
 (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_1)
 (envelope-from <phillip.lord@HIDDEN>)
 id 1bEycS-002w0d-5k; Mon, 20 Jun 2016 13:48:00 +0100
From: phillip.lord@HIDDEN (Phillip Lord)
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#23785: Emacs 25: 'Undo' overdoes things.
References: <20160617150245.GB3316@HIDDEN> <83r3bvbuu1.fsf@HIDDEN>
 <20160617174535.GD3316@HIDDEN> <83oa6zbmvd.fsf@HIDDEN>
 <87ziqjwkrb.fsf@HIDDEN> <83eg7vaq3z.fsf@HIDDEN>
 <jwvmvmi5ohk.fsf-monnier+emacsbugs@HIDDEN> <83bn2y9v80.fsf@HIDDEN>
 <jwv7fdm5l8g.fsf-monnier+emacsbugs@HIDDEN>
 <adeb26a2b322f2e73c614048f518ab98.squirrel@HIDDEN>
 <jwvh9coad9g.fsf-monnier+emacsbugs@HIDDEN>
Date: Mon, 20 Jun 2016 13:47:59 +0100
In-Reply-To: <jwvh9coad9g.fsf-monnier+emacsbugs@HIDDEN> (Stefan Monnier's
 message of "Sun, 19 Jun 2016 20:59:33 -0400")
Message-ID: <874m8oc9hc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.94 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
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@HIDDEN
X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 23785
Cc: acm@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 23785 <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: 0.0 (/)

Stefan Monnier <monnier@HIDDEN> writes:

>> The other fiddles with insert-file-contents and adds an undo. It is this
>> function that has specialized handling for the undo list that is causing
>> the problem. My patch in this case is questionable in that I have randomly
>> pushed a call to undo-boundary near the end. It should probably be
>> somewere better.
>
> Indeed, the problem is not that insert-file-contents fails to add
> a boundary, but rather that it removes an existing one, so we should
> figure out where/why it removes it and change the code to push one back
> after removing it.

I don't understand why you say this. AFAICT, the problem is that the
buffer-undo-list doesn't have a nil after the command has happened.


>> Another possibility would be to have insert-file-contents call
>> "undo-auto--undoable-change" -- this is the root cause of the problem.
>
> Figuring out why undo-auto--undoable-change isn't called for it would be
> good as well, indeed.  After all, it runs after-change-functions, so
> it should call undo-auto--undoable-change.

I think that it does -- it calls "insert_from_buffer" which then calls
"prepare_to_modify_buffer".

I *think* what is happening is that prepare_to_modify_buffer is being
called when buffer-undo-list is specbound to t -- hence the change does
not register as undoable change.

I am somewhat guessing here.

Phil





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

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


Received: (at 23785) by debbugs.gnu.org; 20 Jun 2016 12:33:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 20 08:33:33 2016
Received: from localhost ([127.0.0.1]:47176 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bEyOT-0003FA-1g
	for submit <at> debbugs.gnu.org; Mon, 20 Jun 2016 08:33:33 -0400
Received: from cloud103.planethippo.com ([31.216.48.48]:33257)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <phillip.lord@HIDDEN>) id 1bEyOQ-0003Ev-NH
 for 23785 <at> debbugs.gnu.org; Mon, 20 Jun 2016 08:33:32 -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=n71brAGFonPGjCXP812RWlD7XtRcwnWT0SycLaGpskY=; b=QQsmLk8bjRbWPGQ/zh4ELP3ofi
 Riq30GH7IQ0IALqSqjGOCJ6qT+Atygf21Woq0M66yvuLz0BeAM38ScOsEZHPyEd8QyEdwaxl2opJg
 BRoKTxb85cG1u5RC/XAZiz2ismYzmBAwQQZhjNWzg7YbF6biJj9h64NP06tayJO4lYuTwodop1vzM
 a0xFadn7//2HeAULx4wTu7ciT2+womTq5iVDwG/GX9L86CxO8FDzlp27IvH+Im8QWWFqQ3tb7ahQq
 tC0ivB2YvtG0hu9e08pNaPVhR1p4wPQ0BKrW7XtIWEQsI7/cSN3/dNrxzedCWOAN25j+QbaZc2Dtm
 Yli4HNKQ==;
Received: from janus-nat-128-240-225-83.ncl.ac.uk ([128.240.225.83]:33020
 helo=russet.org.uk) by cloud103.planethippo.com with esmtpsa
 (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_1)
 (envelope-from <phillip.lord@HIDDEN>)
 id 1bEyOK-002toG-N2; Mon, 20 Jun 2016 13:33:24 +0100
From: phillip.lord@HIDDEN (Phillip Lord)
To: =?utf-8?Q?=C3=93scar?= Fuentes <ofv@HIDDEN>
Subject: Re: bug#23785: Emacs 25: "Undo" overdoes things.
References: <20160617150245.GB3316@HIDDEN> <83r3bvbuu1.fsf@HIDDEN>
 <20160617174535.GD3316@HIDDEN> <87inx7iiyn.fsf@HIDDEN>
Date: Mon, 20 Jun 2016 13:33:23 +0100
In-Reply-To: <87inx7iiyn.fsf@HIDDEN> (=?utf-8?Q?=22=C3=93scar?=
 Fuentes"'s message of "Fri, 17 Jun 2016 23:49:52 +0200")
Message-ID: <878ty0ca5o.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.94 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
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@HIDDEN
X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 23785
Cc: Alan Mackenzie <acm@HIDDEN>, 23785 <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: 0.0 (/)

=C3=93scar Fuentes <ofv@HIDDEN> writes:

> Alan Mackenzie <acm@HIDDEN> writes:
>
>> 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.
>
> Me too, although I'm not sure about Emacs being the culprit. I use Evil
> and it adds some heuristics on top of Emacs'.


Do let me know if you find any. It would be nice it evil worked out of
the box with the new release!

Phil




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

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


Received: (at 23785) by debbugs.gnu.org; 20 Jun 2016 00:58:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 19 20:58:06 2016
Received: from localhost ([127.0.0.1]:46820 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bEnXN-0002Je-0I
	for submit <at> debbugs.gnu.org; Sun, 19 Jun 2016 20:58:06 -0400
Received: from pruche.dit.umontreal.ca ([132.204.246.22]:55995)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1bEnXK-0002JU-Ma
 for 23785 <at> debbugs.gnu.org; Sun, 19 Jun 2016 20:57:59 -0400
Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242])
 by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id u5K0vtbJ025822;
 Sun, 19 Jun 2016 20:57:55 -0400
Received: by ceviche.home (Postfix, from userid 20848)
 id 1E80C6614D; Sun, 19 Jun 2016 20:59:33 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: "Phillip Lord" <phillip.lord@HIDDEN>
Subject: Re: bug#23785: Emacs 25: 'Undo' overdoes things.
Message-ID: <jwvh9coad9g.fsf-monnier+emacsbugs@HIDDEN>
References: <20160617150245.GB3316@HIDDEN> <83r3bvbuu1.fsf@HIDDEN>
 <20160617174535.GD3316@HIDDEN> <83oa6zbmvd.fsf@HIDDEN>
 <87ziqjwkrb.fsf@HIDDEN> <83eg7vaq3z.fsf@HIDDEN>
 <jwvmvmi5ohk.fsf-monnier+emacsbugs@HIDDEN> <83bn2y9v80.fsf@HIDDEN>
 <jwv7fdm5l8g.fsf-monnier+emacsbugs@HIDDEN>
 <adeb26a2b322f2e73c614048f518ab98.squirrel@HIDDEN>
Date: Sun, 19 Jun 2016 20:59:33 -0400
In-Reply-To: <adeb26a2b322f2e73c614048f518ab98.squirrel@HIDDEN>
 (Phillip Lord's message of "Sun, 19 Jun 2016 23:45:44 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 1 Rules triggered
	RV5711=0
X-NAI-Spam-Version: 2.3.0.9418 : core <5711> : inlines <4940> : streams
 <1654777> : uri <2234330>
X-Spam-Score: -1.8 (-)
X-Debbugs-Envelope-To: 23785
Cc: acm@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 23785 <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.8 (-)

> The other fiddles with insert-file-contents and adds an undo. It is this
> function that has specialized handling for the undo list that is causing
> the problem. My patch in this case is questionable in that I have randomly
> pushed a call to undo-boundary near the end. It should probably be
> somewere better.

Indeed, the problem is not that insert-file-contents fails to add
a boundary, but rather that it removes an existing one, so we should
figure out where/why it removes it and change the code to push one back
after removing it.

> Another possibility would be to have insert-file-contents call
> "undo-auto--undoable-change" -- this is the root cause of the problem.

Figuring out why undo-auto--undoable-change isn't called for it would be
good as well, indeed.  After all, it runs after-change-functions, so
it should call undo-auto--undoable-change.


        Stefan




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

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


Received: (at 23785) by debbugs.gnu.org; 19 Jun 2016 22:45:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 19 18:45:52 2016
Received: from localhost ([127.0.0.1]:46772 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bElTU-0007kS-MO
	for submit <at> debbugs.gnu.org; Sun, 19 Jun 2016 18:45:52 -0400
Received: from cloud103.planethippo.com ([31.216.48.48]:50909)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <phillip.lord@HIDDEN>) id 1bElTS-0007kC-Mg
 for 23785 <at> debbugs.gnu.org; Sun, 19 Jun 2016 18:45:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=russet.org.uk; s=default; h=Content-Type:MIME-Version:Cc:To:From:Subject:
 Date:References:In-Reply-To:Message-ID;
 bh=9m1kPH+4Vt7lTWHABOWCOtZsUk5RD3TNjIfDJwy4dvg=; b=IjrpU0Xk7FSpN9tlMoJs54beot
 QKJUUUwLBEQihj916Bv7eTwuNe0N0WD0FB/VehPA4daGGF6HHxomvD0QQmrhcmnE4Dhr3GpaezYWc
 wmCOth6IayZxWLsPxqgfFzAhMAMaauXLuDNoXZdaUCU8T4NPhOV2yqjzjj5EUGf2sb5kKczKgbs7Y
 kOCEFv3bbKoaH9c2ASjeQ9FpahDPzmkCDzv2VwZ39KWnKcge3VJBjp/pBTj7cY3rVch/CwClOYfM1
 ET/A7ELmZ+JCMrP1cSapMsVXk4dahQYEwsYM45Sx3GtzklhPfjZ9Ktgwe3FkDMcai27p9XUNK+aMk
 79qg0G9A==;
Received: from [127.0.0.1] (port=40300 helo=cloud103.planethippo.com)
 by cloud103.planethippo.com with esmtpa (Exim 4.86_1)
 (envelope-from <phillip.lord@HIDDEN>)
 id 1bElTL-000Rqz-Vm; Sun, 19 Jun 2016 23:45:44 +0100
Received: from 77.98.219.118 ([77.98.219.118])
 (SquirrelMail authenticated user phillip.lord@HIDDEN)
 by cloud103.planethippo.com with HTTP;
 Sun, 19 Jun 2016 23:45:44 +0100
Message-ID: <adeb26a2b322f2e73c614048f518ab98.squirrel@HIDDEN>
In-Reply-To: <jwv7fdm5l8g.fsf-monnier+emacsbugs@HIDDEN>
References: <20160617150245.GB3316@HIDDEN> <83r3bvbuu1.fsf@HIDDEN>
 <20160617174535.GD3316@HIDDEN> <83oa6zbmvd.fsf@HIDDEN>
 <87ziqjwkrb.fsf@HIDDEN> <83eg7vaq3z.fsf@HIDDEN>
 <jwvmvmi5ohk.fsf-monnier+emacsbugs@HIDDEN> <83bn2y9v80.fsf@HIDDEN>
 <jwv7fdm5l8g.fsf-monnier+emacsbugs@HIDDEN>
Date: Sun, 19 Jun 2016 23:45:44 +0100
Subject: Re: bug#23785: Emacs 25: 'Undo' overdoes things.
From: "Phillip Lord" <phillip.lord@HIDDEN>
To: "Stefan Monnier" <monnier@HIDDEN>
User-Agent: SquirrelMail/1.5.2 [SVN]
MIME-Version: 1.0
Content-Type: multipart/mixed;boundary="----=_20160619234543_99489"
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@HIDDEN
X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 23785
Cc: acm@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 23785 <at> debbugs.gnu.org,
 phillip.lord@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: 0.0 (/)

------=_20160619234543_99489
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

On Sat, June 18, 2016 8:52 pm, Stefan Monnier wrote:
>> My concern is not with the behavior the proposed change intends to get
>> us, the concern is with the unintended consequences of the change.  At
>> this late stage, I'd like to keep the risk of unintended consequences to
>> the minimum, unless we want this change so badly we agree to extend the
>> pretesting by another month or two.
>
> Yes, that's the other side of the coin, indeed.


Attached are another two patches which also solve the issue.

One adds an undo boundary specifically in revert-buffer. Works but is
questionable in that revert-buffer is pluggable -- it can call any
function, other than the default.

The other fiddles with insert-file-contents and adds an undo. It is this
function that has specialized handling for the undo list that is causing
the problem. My patch in this case is questionable in that I have randomly
pushed a call to undo-boundary near the end. It should probably be
somewere better.

Another possibility would be to have insert-file-contents call
"undo-auto--undoable-change" -- this is the root cause of the problem.
Changes are happening.

Also attached is a test case which demonstrates the problem.

So many possibilities!



------=_20160619234543_99489
Content-Type: text/x-patch;
 name="0001-Fix-missing-undo-boundary-after-revert-buffer.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename="0001-Fix-missing-undo-boundary-after-revert-buffer.patch"

From 4250d150cfce6cd461dc6475bac08d7587842e84 Mon Sep 17 00:00:00 2001
From: Phillip Lord <phillip.lord@HIDDEN>
Date: Sun, 19 Jun 2016 21:34:58 +0100
Subject: [PATCH] Fix missing undo-boundary after revert-buffer

 - lisp/files.el (revert-buffer): Ensure an undo-boundary after
   completion.

Addresses Bug#23785
---
 lisp/files.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/files.el b/lisp/files.el
index 1f97fa5..c5d2bab 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -5533,7 +5533,10 @@ revert-buffer
   (let ((revert-buffer-in-progress-p t)
         (revert-buffer-preserve-modes preserve-modes))
     (funcall (or revert-buffer-function #'revert-buffer--default)
-             ignore-auto noconfirm)))
+             ignore-auto noconfirm)
+    ;; Ensure that we have a undo-boundary after reversion (see Bug
+    ;; #23785)
+    (undo-boundary)))
 
 (defun revert-buffer--default (ignore-auto noconfirm)
   "Default function for `revert-buffer'.
-- 
2.9.0

------=_20160619234543_99489
Content-Type: text/x-patch;
 name="0001-Fix-missing-undo-boundary-on-revert.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename="0001-Fix-missing-undo-boundary-on-revert.patch"

From 1b2cd06f4b6f993052632e24c50209816314c004 Mon Sep 17 00:00:00 2001
From: Phillip Lord <phillip.lord@HIDDEN>
Date: Sun, 19 Jun 2016 23:33:22 +0100
Subject: [PATCH] Fix missing undo-boundary on revert

But badly, because I have pushed the undo_boundary call into a fairly
random place in a very long function.
---
 src/fileio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/fileio.c b/src/fileio.c
index b11f923..e01045e 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4500,6 +4500,10 @@ by calling `format-decode', which see.  */)
                              current_buffer->newline_cache,
                              PT - BEG, Z - PT - inserted);
 
+  /* Random push an undo boundary here because I don't know where else
+     to put this call */
+  Fundo_boundary();
+
   if (read_quit)
     Fsignal (Qquit, Qnil);
 
-- 
2.9.0

------=_20160619234543_99489
Content-Type: text/x-emacs-lisp; name="revert-buffer-tests.el"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="revert-buffer-tests.el"

(require 'ert)

(ert-deftest undo-after-revert-buffer ()
  (should-not
   (unwind-protect
       (progn
         (find-file "simple-file.txt")
         (goto-char (point-min))
         (insert "\n")
         (revert-buffer t t)
         (undo-auto--needs-boundary-p))
     (kill-buffer
      (get-file-buffer
       "simple-file.txt")))))
------=_20160619234543_99489
Content-Type: text/plain; name="simple-file.txt"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="simple-file.txt"

line one

------=_20160619234543_99489--






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

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


Received: (at 23785) by debbugs.gnu.org; 18 Jun 2016 19:52:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 18 15:52:23 2016
Received: from localhost ([127.0.0.1]:45456 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bEMI3-0006pc-0Z
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2016 15:52:23 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.181]:60967)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1bEMI0-0006pO-0E
 for 23785 <at> debbugs.gnu.org; Sat, 18 Jun 2016 15:52:21 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0A+FgA731xV/0P0SC1cgxCEAoVVwwsEAgKBPD0QAQEBAQEBAYEKQQWDXQEBAwFWHgUFCws0EhQYDSSINwjPIwEBAQEGAQEBAR6LOoUFB4QtAQS1BCOEFCKCeAEBAQ
X-IPAS-Result: A0A+FgA731xV/0P0SC1cgxCEAoVVwwsEAgKBPD0QAQEBAQEBAYEKQQWDXQEBAwFWHgUFCws0EhQYDSSINwjPIwEBAQEGAQEBAR6LOoUFB4QtAQS1BCOEFCKCeAEBAQ
X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="241903351"
Received: from 45-72-244-67.cpe.teksavvy.com (HELO pastel.home)
 ([45.72.244.67])
 by ironport2-out.teksavvy.com with ESMTP; 18 Jun 2016 15:52:14 -0400
Received: by pastel.home (Postfix, from userid 20848)
 id B657D64BE9; Sat, 18 Jun 2016 15:52:13 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#23785: Emacs 25: "Undo" overdoes things.
Message-ID: <jwv7fdm5l8g.fsf-monnier+emacsbugs@HIDDEN>
References: <20160617150245.GB3316@HIDDEN> <83r3bvbuu1.fsf@HIDDEN>
 <20160617174535.GD3316@HIDDEN> <83oa6zbmvd.fsf@HIDDEN>
 <87ziqjwkrb.fsf@HIDDEN> <83eg7vaq3z.fsf@HIDDEN>
 <jwvmvmi5ohk.fsf-monnier+emacsbugs@HIDDEN> <83bn2y9v80.fsf@HIDDEN>
Date: Sat, 18 Jun 2016 15:52:13 -0400
In-Reply-To: <83bn2y9v80.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 18 Jun
 2016 22:02:07 +0300")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 1.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:  > My concern is not with the behavior the proposed change
 intends to get > us, the concern is with the unintended consequences of the
 change. At > this late stage,
 I'd like to keep the risk of unintended consequences
 > to the minimum, unless we want this change so badly we agree to extend
 > the pretesting by another month or two. [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/, low
 trust [206.248.154.181 listed in list.dnswl.org]
 1.0 FSL_HELO_HOME          No description available.
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [206.248.154.181 listed in wl.mailspike.net]
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
X-Debbugs-Envelope-To: 23785
Cc: acm@HIDDEN, 23785 <at> debbugs.gnu.org, phillip.lord@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.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:  > My concern is not with the behavior the proposed change
   intends to get > us, the concern is with the unintended consequences of the
    change. At > this late stage, I'd like to keep the risk of unintended consequences
    > to the minimum, unless we want this change so badly we agree to extend
   > the pretesting by another month or two. [...] 
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/, low
                             trust
                             [206.248.154.181 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [206.248.154.181 listed in wl.mailspike.net]
  1.0 FSL_HELO_HOME          No description available.
  1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders

> My concern is not with the behavior the proposed change intends to get
> us, the concern is with the unintended consequences of the change.  At
> this late stage, I'd like to keep the risk of unintended consequences
> to the minimum, unless we want this change so badly we agree to extend
> the pretesting by another month or two.

Yes, that's the other side of the coin, indeed.


        Stefan




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

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


Received: (at 23785) by debbugs.gnu.org; 18 Jun 2016 19:01:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 18 15:01:27 2016
Received: from localhost ([127.0.0.1]:45433 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bELUk-0005d3-Rb
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2016 15:01:27 -0400
Received: from eggs.gnu.org ([208.118.235.92]:44952)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1bELUi-0005cn-Di
 for 23785 <at> debbugs.gnu.org; Sat, 18 Jun 2016 15:01:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1bELUa-0007Vg-Aq
 for 23785 <at> debbugs.gnu.org; Sat, 18 Jun 2016 15:01:19 -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.6 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37985)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1bELUa-0007Va-7S; Sat, 18 Jun 2016 15:01:16 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1972
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1bELUX-0008Fm-2P; Sat, 18 Jun 2016 15:01:14 -0400
Date: Sat, 18 Jun 2016 22:02:07 +0300
Message-Id: <83bn2y9v80.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwvmvmi5ohk.fsf-monnier+emacsbugs@HIDDEN> (message from Stefan
 Monnier on Sat, 18 Jun 2016 14:42:07 -0400)
Subject: Re: bug#23785: Emacs 25: "Undo" overdoes things.
References: <20160617150245.GB3316@HIDDEN> <83r3bvbuu1.fsf@HIDDEN>
 <20160617174535.GD3316@HIDDEN> <83oa6zbmvd.fsf@HIDDEN>
 <87ziqjwkrb.fsf@HIDDEN> <83eg7vaq3z.fsf@HIDDEN>
 <jwvmvmi5ohk.fsf-monnier+emacsbugs@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.4 (------)
X-Debbugs-Envelope-To: 23785
Cc: acm@HIDDEN, 23785 <at> debbugs.gnu.org, phillip.lord@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>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.4 (------)

> From: Stefan Monnier <monnier@HIDDEN>
> Cc: phillip.lord@HIDDEN (Phillip Lord),  acm@HIDDEN,  23785 <at> debbugs.gnu.org
> Date: Sat, 18 Jun 2016 14:42:07 -0400
> 
> > 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.
> 
> FWIW, this change you say is scary brings the behavior much closer
> to that of Emacs<25, so I think it's the safer choice.

My concern is not with the behavior the proposed change intends to get
us, the concern is with the unintended consequences of the change.  At
this late stage, I'd like to keep the risk of unintended consequences
to the minimum, unless we want this change so badly we agree to extend
the pretesting by another month or two.




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

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


Received: (at 23785) by debbugs.gnu.org; 18 Jun 2016 18:42:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 18 14:42:17 2016
Received: from localhost ([127.0.0.1]:45405 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bELCC-00056R-VM
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2016 14:42:17 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.181]:43323)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1bELCA-00056D-Vz
 for 23785 <at> debbugs.gnu.org; Sat, 18 Jun 2016 14:42:15 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0A+FgA731xV/0P0SC1cgxCEAoVVwwsEAgKBPD0QAQEBAQEBAYEKQQWDXQEBAwFWIwULCzQSFBgNJIg3CM8jAQEBAQYBAQEBHos6hQUHhC0FtQQjhBQigngBAQE
X-IPAS-Result: A0A+FgA731xV/0P0SC1cgxCEAoVVwwsEAgKBPD0QAQEBAQEBAYEKQQWDXQEBAwFWIwULCzQSFBgNJIg3CM8jAQEBAQYBAQEBHos6hQUHhC0FtQQjhBQigngBAQE
X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="241822216"
Received: from 45-72-244-67.cpe.teksavvy.com (HELO pastel.home)
 ([45.72.244.67])
 by ironport2-out.teksavvy.com with ESMTP; 18 Jun 2016 14:42:08 -0400
Received: by pastel.home (Postfix, from userid 20848)
 id 9A5A964BF4; Sat, 18 Jun 2016 14:42:07 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#23785: Emacs 25: "Undo" overdoes things.
Message-ID: <jwvmvmi5ohk.fsf-monnier+emacsbugs@HIDDEN>
References: <20160617150245.GB3316@HIDDEN> <83r3bvbuu1.fsf@HIDDEN>
 <20160617174535.GD3316@HIDDEN> <83oa6zbmvd.fsf@HIDDEN>
 <87ziqjwkrb.fsf@HIDDEN> <83eg7vaq3z.fsf@HIDDEN>
Date: Sat, 18 Jun 2016 14:42:07 -0400
In-Reply-To: <83eg7vaq3z.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 18 Jun
 2016 10:54:56 +0300")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 1.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: > 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. [...]
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/, low
 trust [206.248.154.181 listed in list.dnswl.org]
 1.0 FSL_HELO_HOME          No description available.
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [206.248.154.181 listed in wl.mailspike.net]
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
X-Debbugs-Envelope-To: 23785
Cc: acm@HIDDEN, 23785 <at> debbugs.gnu.org,
 Phillip Lord <phillip.lord@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.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:  > 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. [...]
    
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/, low
                             trust
                             [206.248.154.181 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [206.248.154.181 listed in wl.mailspike.net]
  1.0 FSL_HELO_HOME          No description available.
  1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders

> 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.

FWIW, this change you say is scary brings the behavior much closer
to that of Emacs<25, so I think it's the safer choice.


        Stefan




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

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


Received: (at 23785) by debbugs.gnu.org; 18 Jun 2016 17:41:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 18 13:41:26 2016
Received: from localhost ([127.0.0.1]:45368 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bEKFK-0001rs-Ba
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2016 13:41:26 -0400
Received: from mail.muc.de ([193.149.48.3]:59003)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1bEKFJ-0001ri-2f
 for 23785 <at> debbugs.gnu.org; Sat, 18 Jun 2016 13:41:25 -0400
Received: (qmail 46150 invoked by uid 3782); 18 Jun 2016 17:41:24 -0000
Received: from acm.muc.de (p548C67AF.dip0.t-ipconnect.de [84.140.103.175]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sat, 18 Jun 2016 19:41:22 +0200
Received: (qmail 6026 invoked by uid 1000); 18 Jun 2016 17:41:36 -0000
Date: Sat, 18 Jun 2016 17:41:36 +0000
To: Phillip Lord <phillip.lord@HIDDEN>
Subject: Re: bug#23785: Emacs 25: "Undo" overdoes things.
Message-ID: <20160618174136.GC5796@HIDDEN>
References: <20160617150245.GB3316@HIDDEN> <83r3bvbuu1.fsf@HIDDEN>
 <20160617174535.GD3316@HIDDEN>
 <877fdny0ew.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <877fdny0ew.fsf@HIDDEN>
User-Agent: Mutt/1.5.24 (2015-08-30)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: 23785
Cc: Eli Zaretskii <eliz@HIDDEN>, 23785 <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.4 (-)

Hello, Phil.

On Fri, Jun 17, 2016 at 10:23:51PM +0100, Phillip Lord wrote:
> Alan Mackenzie <acm@HIDDEN> writes:

> > 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.

For example, at times I've deleted a character, moved point, then deleted
another character.  Undo has undone both deletions as a single operation,
despite the point movement between 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.

The lack of configurability seems to be a problem.  There have been
times, testing times, when I've felt that each deletion of a character is
its own atomic operation.  Yet I can't configure undo to respect this
wish.

[ .... ]

> I will investigate.

> Phil

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 23785) by debbugs.gnu.org; 18 Jun 2016 07:54:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 18 03:54:05 2016
Received: from localhost ([127.0.0.1]:44697 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bEB4u-0007rn-RO
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2016 03:54:05 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52493)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1bEB4t-0007rK-KM
 for 23785 <at> debbugs.gnu.org; Sat, 18 Jun 2016 03:54:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1bEB4l-0004Lh-DJ
 for 23785 <at> debbugs.gnu.org; Sat, 18 Jun 2016 03:53:58 -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.6 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53560)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1bEB4l-0004Ld-9o; Sat, 18 Jun 2016 03:53:55 -0400
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 <eliz@HIDDEN>)
 id 1bEB4j-0006rc-Bq; Sat, 18 Jun 2016 03:53:53 -0400
Date: Sat, 18 Jun 2016 10:54:56 +0300
Message-Id: <83eg7vaq3z.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: phillip.lord@HIDDEN (Phillip Lord)
In-reply-to: <87ziqjwkrb.fsf@HIDDEN> (phillip.lord@HIDDEN)
Subject: Re: bug#23785: Emacs 25: "Undo" overdoes things.
References: <20160617150245.GB3316@HIDDEN> <83r3bvbuu1.fsf@HIDDEN>
 <20160617174535.GD3316@HIDDEN> <83oa6zbmvd.fsf@HIDDEN>
 <87ziqjwkrb.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.4 (------)
X-Debbugs-Envelope-To: 23785
Cc: acm@HIDDEN, 23785 <at> debbugs.gnu.org, monnier@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>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.4 (------)

> From: phillip.lord@HIDDEN (Phillip Lord)
> Cc: Alan Mackenzie <acm@HIDDEN>,  23785 <at> 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 <phillip.lord@HIDDEN>
> 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.




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

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


Received: (at 23785) by debbugs.gnu.org; 18 Jun 2016 04:45:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 18 00:45:12 2016
Received: from localhost ([127.0.0.1]:44678 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bE888-0003NK-Ih
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2016 00:45:12 -0400
Received: from chene.dit.umontreal.ca ([132.204.246.20]:51883)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1bE886-0003NC-J2
 for 23785 <at> debbugs.gnu.org; Sat, 18 Jun 2016 00:45:11 -0400
Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242])
 by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id u5I4jCsh010360;
 Sat, 18 Jun 2016 00:45:12 -0400
Received: by ceviche.home (Postfix, from userid 20848)
 id BBDDA661DE; Sat, 18 Jun 2016 00:46:44 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: phillip.lord@HIDDEN (Phillip Lord)
Subject: Re: bug#23785: Emacs 25: "Undo" overdoes things.
Message-ID: <jwvbn2zcdw6.fsf-monnier+emacsbugs@HIDDEN>
References: <20160617150245.GB3316@HIDDEN> <83r3bvbuu1.fsf@HIDDEN>
 <20160617174535.GD3316@HIDDEN> <83oa6zbmvd.fsf@HIDDEN>
 <87ziqjwkrb.fsf@HIDDEN>
Date: Sat, 18 Jun 2016 00:46:44 -0400
In-Reply-To: <87ziqjwkrb.fsf@HIDDEN> (Phillip Lord's message of "Fri,
 17 Jun 2016 22:47:20 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 1 Rules triggered
	RV5709=0
X-NAI-Spam-Version: 2.3.0.9418 : core <5709> : inlines <4940> : streams
 <1653781> : uri <2233217>
X-Spam-Score: -1.8 (-)
X-Debbugs-Envelope-To: 23785
Cc: Alan Mackenzie <acm@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 23785 <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.8 (-)

> 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.

Looks OK to me, yes.

> 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.

It probably makes 12e009e52 unnecessary, indeed, but I'd argue that
it is wrong of viper-adjust-undo to remove the topmost undo-boundary, so
IMO we should keep 12e009e52 (if not in emacs-25 at least in master).

Similarly I think it's still a bug that revert-buffer removes
a pre-existing undo-boundary (even if that bug ends up hidden by adding
current-buffer unconditionally in undo-auto--boundaries).


        Stefan




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

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


Received: (at 23785) by debbugs.gnu.org; 17 Jun 2016 21:50:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 17 17:50:02 2016
Received: from localhost ([127.0.0.1]:44566 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bE1eM-0000ZY-3g
	for submit <at> debbugs.gnu.org; Fri, 17 Jun 2016 17:50:02 -0400
Received: from smtp21.acens.net ([86.109.99.145]:57031 helo=smtp.movistar.es)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ofv@HIDDEN>) id 1bE1eK-0000Z0-FN
 for 23785 <at> debbugs.gnu.org; Fri, 17 Jun 2016 17:50:01 -0400
X-CTCH-RefID: str=0001.0A0B0207.57647081.00A8, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
Received: from qcore (217.125.182.141) by smtp.movistar.es (8.6.122.03)
 (authenticated as 981711563$telefonica.net)
 id 574060E70161AAF6; Fri, 17 Jun 2016 21:49:53 +0000
From: =?utf-8?Q?=C3=93scar_Fuentes?= <ofv@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: bug#23785: Emacs 25: "Undo" overdoes things.
References: <20160617150245.GB3316@HIDDEN> <83r3bvbuu1.fsf@HIDDEN>
 <20160617174535.GD3316@HIDDEN>
Date: Fri, 17 Jun 2016 23:49:52 +0200
In-Reply-To: <20160617174535.GD3316@HIDDEN> (Alan Mackenzie's message
 of "Fri, 17 Jun 2016 17:45:35 +0000")
Message-ID: <87inx7iiyn.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 23785
Cc: Eli Zaretskii <eliz@HIDDEN>, 23785 <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: -0.7 (/)

Alan Mackenzie <acm@HIDDEN> writes:

> 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.

Me too, although I'm not sure about Emacs being the culprit. I use Evil
and it adds some heuristics on top of Emacs'.

> 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).
>
> And having to undo/redo command sequences by hand is _very_ irritating
> when testing.

Only when testing? :-)

I've observed cases where sequences of char inserts were undone one at a
time and cases where entire edit sessions across multiple areas of the
file vanished with one `undo'.

> I think there's a case to be made for fixing this bug for Emacs 25.1.

FWIW, this is the change that enabled keeping the undo log after
revert-buffer (a feature I asked for, BTW):


commit 22513e526eba97bd1014e4bacde0a8649fbe7870
Author: Stefan Monnier <monnier@HIDDEN>
Date:   Tue May 28 21:07:53 2013 -0400

    * src/fileio.c (Finsert_file_contents): Preserve undo info when reverting
    a buffer.
    
    Fixes: debbugs:8447





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

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


Received: (at 23785) by debbugs.gnu.org; 17 Jun 2016 21:47:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 17 17:47:30 2016
Received: from localhost ([127.0.0.1]:44562 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bE1bu-0000Vn-Lb
	for submit <at> debbugs.gnu.org; Fri, 17 Jun 2016 17:47:30 -0400
Received: from cloud103.planethippo.com ([31.216.48.48]:48327)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <phillip.lord@HIDDEN>) id 1bE1bs-0000VX-Bc
 for 23785 <at> debbugs.gnu.org; Fri, 17 Jun 2016 17:47:29 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=russet.org.uk; s=default; h=Content-Type:MIME-Version:Message-ID:
 In-Reply-To:Date:References:Subject:Cc:To:From;
 bh=TG1uuc/JweNswVRl8BdkBWLqzVXNrwekJsxy8duPuGQ=; b=1706RxTEl4j3ZMZX9KwK7/yh07
 SsmpTvjoxBgynFXJ4suxgkB0iuj3UQs1ucxuPy0QEb3qP5fF0frGX1d0jf+++O3asvTfaEpIIDH9I
 iLyV3zpiFp8/AaZPjjegMv4fn7HaR7IniAxBbMOJ3zz3EJLv5VdOSGQUksZWQn3k4SfzJ/V1b6UWy
 RDlacT4h4KU8LYYZOloix9oAXSblLR6Cu5WfyaNXgumfGEcn8Hdw7Ve1oU+3heDbobM2qQjWB9hRX
 TyzRtlIQIxKDpD6FcGqmf0hKQbF830K9HHtG0oLzLbPvEw/9WqeOiE6q9xLKfIJEjNl3uRIBU9oRT
 cJlAEFLQ==;
Received: from cpc1-benw10-2-0-cust373.gate.cable.virginm.net
 ([77.98.219.118]:50444 helo=russet.org.uk)
 by cloud103.planethippo.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128)
 (Exim 4.86_1) (envelope-from <phillip.lord@HIDDEN>)
 id 1bE1bl-001awA-Nb; Fri, 17 Jun 2016 22:47:21 +0100
From: phillip.lord@HIDDEN (Phillip Lord)
To: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#23785: Emacs 25: "Undo" overdoes things.
References: <20160617150245.GB3316@HIDDEN> <83r3bvbuu1.fsf@HIDDEN>
 <20160617174535.GD3316@HIDDEN> <83oa6zbmvd.fsf@HIDDEN>
Date: Fri, 17 Jun 2016 22:47:20 +0100
In-Reply-To: <83oa6zbmvd.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 17 Jun
 2016 23:07:18 +0300")
Message-ID: <87ziqjwkrb.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
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@HIDDEN
X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 23785
Cc: Alan Mackenzie <acm@HIDDEN>, 23785 <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: 0.0 (/)

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

Eli Zaretskii <eliz@HIDDEN> writes:

>> I think there's a case to be made for fixing this bug for Emacs 25.1.
>
> It depends on what the fix will look like.  If it's simple and safe
> enough, I'll agree.


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.

Phil


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
 filename=0001-Fix-missing-undo-boundary-after-revert-buffer.patch

From 2ab1f314ad6fe0e68420cc510445495467d82b8f Mon Sep 17 00:00:00 2001
From: Phillip Lord <phillip.lord@HIDDEN>
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
-- 
2.8.4


--=-=-=--




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

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


Received: (at 23785) by debbugs.gnu.org; 17 Jun 2016 21:24:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 17 17:24:01 2016
Received: from localhost ([127.0.0.1]:44552 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bE1FB-0008P7-9s
	for submit <at> debbugs.gnu.org; Fri, 17 Jun 2016 17:24:01 -0400
Received: from cloud103.planethippo.com ([31.216.48.48]:47324)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <phillip.lord@HIDDEN>) id 1bE1F9-0008Oq-BR
 for 23785 <at> 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==;
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 <phillip.lord@HIDDEN>)
 id 1bE1F3-001XCT-0N; Fri, 17 Jun 2016 22:23:53 +0100
From: phillip.lord@HIDDEN (Phillip Lord)
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: bug#23785: Emacs 25: "Undo" overdoes things.
References: <20160617150245.GB3316@HIDDEN> <83r3bvbuu1.fsf@HIDDEN>
 <20160617174535.GD3316@HIDDEN>
Date: Fri, 17 Jun 2016 22:23:51 +0100
In-Reply-To: <20160617174535.GD3316@HIDDEN> (Alan Mackenzie's message
 of "Fri, 17 Jun 2016 17:45:35 +0000")
Message-ID: <877fdny0ew.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
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@HIDDEN
X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 23785
Cc: Eli Zaretskii <eliz@HIDDEN>, 23785 <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: 0.0 (/)

Alan Mackenzie <acm@HIDDEN> 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 <acm@HIDDEN>
>
>> > 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)
 (#<marker at 1 in simple-example.txt> . -1)
 (#<marker at 1 in simple-example.txt> . -1)
 (#<marker in no buffer> . -1)
 nil
 (1 . 2)
 (t 22372 26717 127527 392000))

*** After undo changes

(("\n" . -1)
 (#<marker at 1 in simple-example.txt> . -1)
 (#<marker at 1 in simple-example.txt> . -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




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

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


Received: (at 23785) by debbugs.gnu.org; 17 Jun 2016 20:06:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 17 16:06:29 2016
Received: from localhost ([127.0.0.1]:44521 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bE028-0006TS-NZ
	for submit <at> debbugs.gnu.org; Fri, 17 Jun 2016 16:06:28 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33945)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1bE027-0006TB-H9
 for 23785 <at> debbugs.gnu.org; Fri, 17 Jun 2016 16:06:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1bE01y-0000bt-8C
 for 23785 <at> debbugs.gnu.org; Fri, 17 Jun 2016 16:06:22 -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.6 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43551)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1bE01y-0000bn-5B; Fri, 17 Jun 2016 16:06:18 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4648
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1bE01w-0001M4-5F; Fri, 17 Jun 2016 16:06:16 -0400
Date: Fri, 17 Jun 2016 23:07:18 +0300
Message-Id: <83oa6zbmvd.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
In-reply-to: <20160617174535.GD3316@HIDDEN> (message from Alan
 Mackenzie on Fri, 17 Jun 2016 17:45:35 +0000)
Subject: Re: bug#23785: Emacs 25: "Undo" overdoes things.
References: <20160617150245.GB3316@HIDDEN>
 <83r3bvbuu1.fsf@HIDDEN> <20160617174535.GD3316@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.4 (------)
X-Debbugs-Envelope-To: 23785
Cc: 23785 <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>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.4 (------)

> Date: Fri, 17 Jun 2016 17:45:35 +0000
> Cc: 23785 <at> debbugs.gnu.org
> From: Alan Mackenzie <acm@HIDDEN>
> 
> > > 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 = init;".  Call this line 16.
> > > 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 (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.

You are being unreasonably subjective on this one.

> `undo' can no longer be depended upon to restore a buffer to its
> unchanged state.

Undo is about undoing changes, and it is documented to lump several
changes together in some situations.  So your expectations are
unreasonably unrealistic to begin with.

> 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).

I don't think this is true, and in any case see no big difference
between several commands each deleting one character and a single
command deleting several characters at once.

> I think there's a case to be made for fixing this bug for Emacs 25.1.

It depends on what the fix will look like.  If it's simple and safe
enough, I'll agree.




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

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


Received: (at 23785) by debbugs.gnu.org; 17 Jun 2016 17:45:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 17 13:45:27 2016
Received: from localhost ([127.0.0.1]:44470 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bDxpe-00033E-Ol
	for submit <at> debbugs.gnu.org; Fri, 17 Jun 2016 13:45:26 -0400
Received: from mail.muc.de ([193.149.48.3]:27370)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1bDxpb-000333-Fx
 for 23785 <at> debbugs.gnu.org; Fri, 17 Jun 2016 13:45:25 -0400
Received: (qmail 40561 invoked by uid 3782); 17 Jun 2016 17:45:22 -0000
Received: from acm.muc.de (p548C685D.dip0.t-ipconnect.de [84.140.104.93]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Fri, 17 Jun 2016 19:45:20 +0200
Received: (qmail 8145 invoked by uid 1000); 17 Jun 2016 17:45:35 -0000
Date: Fri, 17 Jun 2016 17:45:35 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#23785: Emacs 25: "Undo" overdoes things.
Message-ID: <20160617174535.GD3316@HIDDEN>
References: <20160617150245.GB3316@HIDDEN>
 <83r3bvbuu1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <83r3bvbuu1.fsf@HIDDEN>
User-Agent: Mutt/1.5.24 (2015-08-30)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: 23785
Cc: 23785 <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.4 (-)

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 <acm@HIDDEN>

> > 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=no --with-gif=no --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 = init;".  Call this line 16.
> > 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 (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.

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).

And having to undo/redo command sequences by hand is _very_ irritating
when testing.

I think there's a case to be made for fixing this bug for Emacs 25.1.

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 23785) by debbugs.gnu.org; 17 Jun 2016 17:14:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 17 13:14:29 2016
Received: from localhost ([127.0.0.1]:44460 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bDxLg-0002L5-TE
	for submit <at> debbugs.gnu.org; Fri, 17 Jun 2016 13:14:29 -0400
Received: from eggs.gnu.org ([208.118.235.92]:53164)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1bDxLf-0002Kr-4u
 for 23785 <at> debbugs.gnu.org; Fri, 17 Jun 2016 13:14:28 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1bDxLV-00037q-Mq
 for 23785 <at> debbugs.gnu.org; Fri, 17 Jun 2016 13:14:21 -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.6 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41212)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1bDxLV-00037a-Jg; Fri, 17 Jun 2016 13:14:17 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4555
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1bDxLT-00084h-S4; Fri, 17 Jun 2016 13:14:16 -0400
Date: Fri, 17 Jun 2016 20:15:18 +0300
Message-Id: <83r3bvbuu1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
In-reply-to: <20160617150245.GB3316@HIDDEN> (message from Alan
 Mackenzie on Fri, 17 Jun 2016 15:02:45 +0000)
Subject: Re: bug#23785: Emacs 25: "Undo" overdoes things.
References: <20160617150245.GB3316@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.4 (------)
X-Debbugs-Envelope-To: 23785
Cc: 23785 <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>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.4 (------)

> Date: Fri, 17 Jun 2016 15:02:45 +0000
> From: Alan Mackenzie <acm@HIDDEN>
> 
> 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=no --with-gif=no --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 = init;".  Call this line 16.
> 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 (which is a bug).

Why does this minor issue deserve to declare 'undo' "broken"?  Looks
like an exaggeration to me.





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

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


Received: (at submit) by debbugs.gnu.org; 17 Jun 2016 15:02:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 17 11:02:48 2016
Received: from localhost ([127.0.0.1]:44403 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bDvIF-0007az-PA
	for submit <at> debbugs.gnu.org; Fri, 17 Jun 2016 11:02:47 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41309)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1bDvID-0007an-IS
 for submit <at> debbugs.gnu.org; Fri, 17 Jun 2016 11:02:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <acm@HIDDEN>) id 1bDvI7-0003zk-C9
 for submit <at> debbugs.gnu.org; Fri, 17 Jun 2016 11:02:40 -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.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:39394)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <acm@HIDDEN>)
 id 1bDvI7-0003zf-9O
 for submit <at> debbugs.gnu.org; Fri, 17 Jun 2016 11:02:39 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60418)
 by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <acm@HIDDEN>)
 id 1bDvI5-0002HS-CB
 for bug-gnu-emacs@HIDDEN; Fri, 17 Jun 2016 11:02:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <acm@HIDDEN>) id 1bDvI0-0003vl-Jm
 for bug-gnu-emacs@HIDDEN; Fri, 17 Jun 2016 11:02:36 -0400
Received: from mail.muc.de ([193.149.48.3]:40029)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <acm@HIDDEN>)
 id 1bDvI0-0003uG-9E
 for bug-gnu-emacs@HIDDEN; Fri, 17 Jun 2016 11:02:32 -0400
Received: (qmail 86867 invoked by uid 3782); 17 Jun 2016 15:02:30 -0000
Received: from acm.muc.de (p548C685D.dip0.t-ipconnect.de [84.140.104.93]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Fri, 17 Jun 2016 17:02:29 +0200
Received: (qmail 6855 invoked by uid 1000); 17 Jun 2016 15:02:45 -0000
Date: Fri, 17 Jun 2016 15:02:45 +0000
To: bug-gnu-emacs@HIDDEN
Subject: Emacs 25: "Undo" overdoes things.
Message-ID: <20160617150245.GB3316@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="G4iJoqBmSsgzjUCe"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
User-Agent: Mutt/1.5.24 (2015-08-30)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.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.3 (----)
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.3 (----)


--G4iJoqBmSsgzjUCe
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

Hello, Emacs.

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=no --with-gif=no --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 = init;".  Call this line 16.
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 (which is a bug).

[For reference, the pertinent part of the file looks like this.  In the
actual file "Type" is at column zero:

14.   Type var = init, x = Type();
15.   Type (*var) = init;
16.   Type var[3 * peq] = init;
16.  Type var = init;         <======== inserted line.
17.   Type (var) = init;
18.   Type int = "int";               // int

].

-- 
Alan Mackenzie (Nuremberg, Germany).


--G4iJoqBmSsgzjUCe
Content-Type: text/x-c; charset=us-ascii
Content-Disposition: attachment; filename="decls-6.cc"

__INLINE__ FOO Type var, x;
__INLINE__ FOO Type *var;
__INLINE__ FOO Type var[3 * peq];

// This is an init paren that currently incorrectly causes the
// variable to be recognized as a function.
__INLINE__ FOO Type var (peq);

__INLINE__ FOO Type var = init, x = Type();
__INLINE__ FOO Type (*var) = init;
__INLINE__ FOO Type var[3 * peq] = init;
__INLINE__ FOO Type var int = "int"; // int

Type var = init, x = Type();
Type (*var) = init;
Type var[3 * peq] = init;
Type (var) = init;
Type int = "int";		// int

const Type var;
const Type (*var);
const Type var[3 * peq];
const Type (var);

Type (*foo) (Type *,
	     Type (*)[x],
	     Type (*var)[x],
	     // An incorrect one that gets "var" recorded as a type.
	     Type (var*)[x],
	     Type &);

Type2 var;
Type var;
Type (*var);			// Currently treated as function call.
Type (*var)[3];
Type var[3 * peq];
Type (var);			// Currently treated as function call.
Type (var)();
::Type var;

unsigned foo bar;
long long x;
long double y;
int x y;			// Invalid
int int y;			// Invalid

// This should be last to check a certain case.
#define low_assign_multiset_index(TO, NODE) do {			\
    struct svalue *_ms_index_to2_ = (TO);				\
  } while (0)

--G4iJoqBmSsgzjUCe--




Acknowledgement sent to Alan Mackenzie <acm@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#23785; 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: Mon, 20 Jun 2016 15:45:01 UTC

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