From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Unbalanced change hooks (part 2) Date: Tue, 2 Aug 2016 19:38:35 +0000 Message-ID: <20160802193835.GF2328@acm.fritz.box> References: <20160731121642.GB2205@acm.fritz.box> <20160802101549.GA2328@acm.fritz.box> <83r3a7md69.fsf@gnu.org> <20160802165545.GD2328@acm.fritz.box> <83fuqnm6og.fsf@gnu.org> <83eg67m3aq.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1470166774 20591 195.159.176.226 (2 Aug 2016 19:39:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 2 Aug 2016 19:39:34 +0000 (UTC) User-Agent: Mutt/1.5.24 (2015-08-30) Cc: ofv@wanadoo.es, rcopley@gmail.com, rms@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 02 21:39:30 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bUfXF-0004vU-6r for ged-emacs-devel@m.gmane.org; Tue, 02 Aug 2016 21:39:29 +0200 Original-Received: from localhost ([::1]:58617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUfXB-0006Cq-MX for ged-emacs-devel@m.gmane.org; Tue, 02 Aug 2016 15:39:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUfX5-0006Ce-Ha for emacs-devel@gnu.org; Tue, 02 Aug 2016 15:39:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUfX1-0003Cp-Hn for emacs-devel@gnu.org; Tue, 02 Aug 2016 15:39:18 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:23216) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUfX1-0003CO-Am for emacs-devel@gnu.org; Tue, 02 Aug 2016 15:39:15 -0400 Original-Received: (qmail 33978 invoked by uid 3782); 2 Aug 2016 19:39:14 -0000 Original-Received: from acm.muc.de (p548C7CD5.dip0.t-ipconnect.de [84.140.124.213]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 02 Aug 2016 21:39:12 +0200 Original-Received: (qmail 5070 invoked by uid 1000); 2 Aug 2016 19:38:35 -0000 Content-Disposition: inline In-Reply-To: <83eg67m3aq.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 193.149.48.3 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:206367 Archived-At: Hello, Eli. On Tue, Aug 02, 2016 at 09:30:37PM +0300, Eli Zaretskii wrote: > > Date: Tue, 02 Aug 2016 20:17:35 +0300 > > From: Eli Zaretskii > > Cc: ofv@wanadoo.es, rcopley@gmail.com, rms@gnu.org, emacs-devel@gnu.org > > > Anyhow, it's not just CC Mode. As already discussed, there are 13 other > > > files which use before-change-functions, and some of these uses are > > > going to assume it works as documented, just as CC Mode did. Sporadic > > > failures are going to occur in some of these other places, due to those > > > hook functions sometimes not being called. > > I will believe that when I see specific bug reports about those other > > packages. > Btw, I'm slowly but surely arriving to the conclusion that the > problems we are discussing can only happen when insert-file-contents > is called with VISIT and REPLACE non-nil, i.e. when reverting a > buffer. Do we have any evidence to the contrary? As long as C-x C-f on a file changed outside of Emacs is included in "reverting", then no. > If we do, can someone show or point to such contradicting evidence? You haven't said how you reached this conclusion. I've grepped for calls of the five functions (insert_1_both, replace_range, del_range_\(1\|byte\|both\)) which have `prepare' parameters, and noted where the argument is false. I see 15 occurrences. They are in callproc.c, coding.c, editfns.c, fileio.c, fns.c, insdel.c, print.c, and xdisp.c. Can you persuade me that it wouldn't be a good use of my time to look at each of these 15 occurrences? :-) > If my conclusion is correct, then we should probably focus on this > particular use case and look for a solution for it, as opposed to > trying to solve some more general problem that seems not to exist. It > might be much easier and simpler. I hope you're right. -- Alan Mackenzie (Nuremberg, Germany).