From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.bugs Subject: bug#23785: Emacs 25: 'Undo' overdoes things. Date: Tue, 21 Jun 2016 15:29:47 +0100 Message-ID: <87ziqety1w.fsf@russet.org.uk> References: <20160617150245.GB3316@acm.fritz.box> <83r3bvbuu1.fsf@gnu.org> <20160617174535.GD3316@acm.fritz.box> <83oa6zbmvd.fsf@gnu.org> <87ziqjwkrb.fsf@russet.org.uk> <83eg7vaq3z.fsf@gnu.org> <83bn2y9v80.fsf@gnu.org> <87vb13ewc8.fsf@russet.org.uk> <83eg7q7k9b.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466519492 29739 80.91.229.3 (21 Jun 2016 14:31:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jun 2016 14:31:32 +0000 (UTC) Cc: acm@muc.de, 23785@debbugs.gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 21 16:31:23 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bFMhp-0005QX-PG for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Jun 2016 16:31:10 +0200 Original-Received: from localhost ([::1]:52314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFMhp-0007vx-3Y for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Jun 2016 10:31:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFMgp-0007Hi-KO for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2016 10:30:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFMgl-0002jl-6j for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2016 10:30:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFMgl-0002jc-3g for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2016 10:30:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bFMgk-0005Ml-Sw for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2016 10:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: phillip.lord@russet.org.uk (Phillip Lord) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Jun 2016 14:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23785 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23785-submit@debbugs.gnu.org id=B23785.146651939520594 (code B ref 23785); Tue, 21 Jun 2016 14:30:02 +0000 Original-Received: (at 23785) by debbugs.gnu.org; 21 Jun 2016 14:29:55 +0000 Original-Received: from localhost ([127.0.0.1]:49862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFMgd-0005M5-9Y for submit@debbugs.gnu.org; Tue, 21 Jun 2016 10:29:55 -0400 Original-Received: from cloud103.planethippo.com ([31.216.48.48]:50757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFMgb-0005Ls-V4 for 23785@debbugs.gnu.org; Tue, 21 Jun 2016 10:29:54 -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=dY1Th23vT4qYiUJJhcLzjPgKZ3IJNXcNDWatR1mfQfM=; b=a0/FvsrxGx2lhD2m6SqIqZ0M7V yH/Rv+GW9mc3Il+j2+6a8qTmwZuZMRmvyluAyZXaie0GLh93b4qR/3CgSnZX9guDsMhLjCisId50D gQcDuBz+N9gy1NqmbXs6nioTq9gUgKLZJkMJktUNhNSrJsiYg/+GMDPflcVQf3FAqCI0Ud6si9du1 D35CxPesxiqjvpXnRw2A0LdXbN+OGvPZF9Gx508Z1ayhk/kRZeAek6ahZqODMwrF+AKmy0xZfbKup Bb0u6y+vHkCtKTLoAE/eFmO0CUQRYf3KxDYTu67Cr9rtC6LaeIrWgICtaVSNifWgDbxO0bAN/LWTv 1yvrjtug==; Original-Received: from janus-nat-128-240-225-60.ncl.ac.uk ([128.240.225.60]:33343 helo=russet.org.uk) by cloud103.planethippo.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86_1) (envelope-from ) id 1bFMgV-002bDo-Lh; Tue, 21 Jun 2016 15:29:47 +0100 In-Reply-To: <83eg7q7k9b.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 21 Jun 2016 16:18:40 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud103.planethippo.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - russet.org.uk X-Get-Message-Sender-Via: cloud103.planethippo.com: authenticated_id: phillip.lord@russet.org.uk X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@russet.org.uk X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:119887 Archived-At: Eli Zaretskii writes: >> From: phillip.lord@russet.org.uk (Phillip Lord) >> Cc: "Eli Zaretskii" , acm@muc.de, 23785@debbugs.gnu.org >> Date: Mon, 20 Jun 2016 16:03:35 +0100 >> >> 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. > > So can you please show the "previous" patch? There were too many of > them. This one, to master. >>From 2ab1f314ad6fe0e68420cc510445495467d82b8f Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Fri, 17 Jun 2016 22:34:50 +0100 Subject: [PATCH] Fix missing undo-boundary after revert-buffer * lisp/simple.el (undo-auto--boundaries): Ensure an undo-boundary after every command whether it (apparently) changes the buffer or not. Addresses Bug#23785 --- lisp/simple.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/simple.el b/lisp/simple.el index b66827d..3110430 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2875,6 +2875,10 @@ undo-auto--boundaries "Check recently changed buffers and add a boundary if necessary. REASON describes the reason that the boundary is being added; see `undo-last-boundary' for more information." + ;; (Bug #23785) All commands should ensure that there is an undo + ;; boundary whether they have changed the current buffer or not. + (when (eq cause 'command) + (add-to-list 'undo-auto--undoably-changed-buffers (current-buffer))) (dolist (b undo-auto--undoably-changed-buffers) (when (buffer-live-p b) (with-current-buffer b -- 2.8.4