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.devel Subject: Re: Commit for emacs-25, fixing undo with revert-buffer Date: Tue, 05 Jul 2016 10:45:38 +0100 Message-ID: <8737nobepp.fsf@russet.org.uk> References: <06759cf52b3dd9c6a684b1ecaafa2e16.squirrel@cloud103.planethippo.com> <83k2h6vg7x.fsf@gnu.org> <87mvlxifl7.fsf@russet.org.uk> <838txhpe8n.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1467712433 22016 80.91.229.3 (5 Jul 2016 09:53:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Jul 2016 09:53:53 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 05 11:53:43 2016 Return-path: Envelope-to: ged-emacs-devel@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 1bKN30-000757-Tr for ged-emacs-devel@m.gmane.org; Tue, 05 Jul 2016 11:53:43 +0200 Original-Received: from localhost ([::1]:53586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKN30-0007NI-6t for ged-emacs-devel@m.gmane.org; Tue, 05 Jul 2016 05:53:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKN2u-0007Mu-Cp for emacs-devel@gnu.org; Tue, 05 Jul 2016 05:53:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKN2t-0002Dl-53 for emacs-devel@gnu.org; Tue, 05 Jul 2016 05:53:36 -0400 Original-Received: from cloud103.planethippo.com ([31.216.48.48]:48121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKN2o-0002DE-MJ; Tue, 05 Jul 2016 05:53:30 -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=bMcog1dAezlvyJJ3sr5q7AmF5TUaORMv0cMhShLKM4o=; b=g6YtUD201aw8Er95GVaHLjBa9D dSLA4zlE45McKXdNYvNto4FL0+kZ7GVMdHgvQQm0c15cR7I+PGu2UtpTbGkrk0qUp6FuoLItnDQ2r zIj+xa7uJQXMG0E7Tgnh0+7kbgMPHYu+A6XZhRmkO51W1KhoVpDAeJOdtNMPCKGWoNUU3rgJzI7OY kHQp2pDtWefSBxdeEAk2N8M9kloRiiiD4C7dK14rEHNqCd0ArihzYza3XgTZSXVhZrzUIRK56DZu9 mtslbnJkGx9MHHAGC78mdHjJGkXXbuOBbxCoRh/YEceJcPp8K6z86bMUCrJp7P18qOgtZ+ebPgZRj tLC/32Hw==; Original-Received: from janus-nat-128-240-225-60.ncl.ac.uk ([128.240.225.60]:32608 helo=russet.org.uk) by cloud103.planethippo.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86_1) (envelope-from ) id 1bKN2n-000A63-DN; Tue, 05 Jul 2016 10:53:29 +0100 In-Reply-To: <838txhpe8n.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 04 Jul 2016 19:19:52 +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 - 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-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 31.216.48.48 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:205171 Archived-At: Eli Zaretskii writes: >> Stefan, just pinging. Would like to get this bug cleared anyway (you've >> seen this patch already, although I think I have cleaned it up a bit). > > I think you have the bug number wrong, and Stefan did respond to your > patch wrt bug#23871: > > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23871#98 Sorry, different one. Bug# 23785 and this patch. Phil >>From d425b7875b162cabf65661e42b62b5e54344ffe6 Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Tue, 28 Jun 2016 08:02:51 +0100 Subject: [PATCH] Fix missing undo-boundary on revert-buffer. * src/fileio.c (insert-file-contents): Call undo-auto--undoable-change Addresses Bug#23785. Do not merge to master as c98bc98 also addresses the same bug. --- lisp/simple.el | 10 +++++++++- src/fileio.c | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/simple.el b/lisp/simple.el index b66827d..43ad43c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2940,9 +2940,17 @@ undo-auto-amalgamate (cdr buffer-undo-list)))))) (setq undo-auto--last-boundary-cause 0))))) +;; This function is called also from one place in fileio.c. We call +;; this function, rather than undoable-change because it reduces the +;; number of lisp functions we have to use fboundp for to avoid +;; bootstrap issues. +(defun undo-auto--undoable-change-no-timer () + "Record `current-buffer' as changed." + (add-to-list 'undo-auto--undoably-changed-buffers (current-buffer))) + (defun undo-auto--undoable-change () "Called after every undoable buffer change." - (add-to-list 'undo-auto--undoably-changed-buffers (current-buffer)) + (undo-auto--undoable-change-no-timer) (undo-auto--boundary-ensure-timer)) ;; End auto-boundary section diff --git a/src/fileio.c b/src/fileio.c index b11f923..3005ca3 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3436,6 +3436,9 @@ by calling `format-decode', which see. */) if (!NILP (BVAR (current_buffer, read_only))) Fbarf_if_buffer_read_only (Qnil); + if (!NILP (Ffboundp (Qundo_auto__undoable_change_no_timer))) + call0 (Qundo_auto__undoable_change_no_timer); + val = Qnil; p = Qnil; orig_filename = Qnil; @@ -5797,6 +5800,8 @@ syms_of_fileio (void) which gives a list of operations it handles. */ DEFSYM (Qoperations, "operations"); + DEFSYM (Qundo_auto__undoable_change_no_timer, "undo-auto--undoable-change-no-timer"); + DEFSYM (Qexpand_file_name, "expand-file-name"); DEFSYM (Qsubstitute_in_file_name, "substitute-in-file-name"); DEFSYM (Qdirectory_file_name, "directory-file-name"); -- 2.9.0