From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.bugs Subject: bug#23785: Emacs 25: "Undo" overdoes things. Date: Fri, 17 Jun 2016 22:47:20 +0100 Message-ID: <87ziqjwkrb.fsf@russet.org.uk> References: <20160617150245.GB3316@acm.fritz.box> <83r3bvbuu1.fsf@gnu.org> <20160617174535.GD3316@acm.fritz.box> <83oa6zbmvd.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1466200108 32612 80.91.229.3 (17 Jun 2016 21:48:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Jun 2016 21:48:28 +0000 (UTC) Cc: Alan Mackenzie , 23785@debbugs.gnu.org To: Eli Zaretskii , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 17 23:48:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bE1cc-00014H-Ue for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Jun 2016 23:48:15 +0200 Original-Received: from localhost ([::1]:60404 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE1cb-0003sN-IU for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Jun 2016 17:48:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE1cV-0003qh-Sz for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 17:48:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bE1cP-0005oQ-Vi for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 17:48:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE1cP-0005oM-SG for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 17:48:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bE1cP-0000WX-Km for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 17:48:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: phillip.lord@russet.org.uk (Phillip Lord) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Jun 2016 21:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23785 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23785-submit@debbugs.gnu.org id=B23785.14662000511975 (code B ref 23785); Fri, 17 Jun 2016 21:48:01 +0000 Original-Received: (at 23785) by debbugs.gnu.org; 17 Jun 2016 21:47:31 +0000 Original-Received: from localhost ([127.0.0.1]:44562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bE1bu-0000Vn-Lb for submit@debbugs.gnu.org; Fri, 17 Jun 2016 17:47:30 -0400 Original-Received: from cloud103.planethippo.com ([31.216.48.48]:48327) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bE1bs-0000VX-Bc for 23785@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==; Original-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 ) id 1bE1bl-001awA-Nb; Fri, 17 Jun 2016 22:47:21 +0100 In-Reply-To: <83oa6zbmvd.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 17 Jun 2016 23:07:18 +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:119699 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii 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 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 --=-=-=--