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: Sun, 31 Jul 2016 19:33:20 +0000 Message-ID: <20160731193320.GE2205@acm.fritz.box> References: <20160731121642.GB2205@acm.fritz.box> <83a8gxq288.fsf@gnu.org> <20160731172804.GD2205@acm.fritz.box> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1469993671 24626 80.91.229.8 (31 Jul 2016 19:34:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 31 Jul 2016 19:34:31 +0000 (UTC) User-Agent: Mutt/1.5.24 (2015-08-30) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 31 21:34:16 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 1bTwV6-0006KP-Lz for ged-emacs-devel@m.gmane.org; Sun, 31 Jul 2016 21:34:16 +0200 Original-Received: from localhost ([::1]:40610 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTwV2-0006IC-Sg for ged-emacs-devel@m.gmane.org; Sun, 31 Jul 2016 15:34:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTwUx-0006I6-GO for emacs-devel@gnu.org; Sun, 31 Jul 2016 15:34:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTwUs-0001Kf-G3 for emacs-devel@gnu.org; Sun, 31 Jul 2016 15:34:06 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:45299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTwUs-0001Kb-5k for emacs-devel@gnu.org; Sun, 31 Jul 2016 15:34:02 -0400 Original-Received: (qmail 43731 invoked by uid 3782); 31 Jul 2016 19:34:01 -0000 Original-Received: from acm.muc.de (p548C7DF4.dip0.t-ipconnect.de [84.140.125.244]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 31 Jul 2016 21:33:59 +0200 Original-Received: (qmail 5037 invoked by uid 1000); 31 Jul 2016 19:33:20 -0000 Content-Disposition: inline In-Reply-To: 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:206286 Archived-At: Hello, Stefan. On Sun, Jul 31, 2016 at 02:55:32PM -0400, Stefan Monnier wrote: > > These hook variables let you arrange to take notice of ALL changes > > in ALL buffers. [My emphasis] > > Your interpretation of that seems to be that each buffer change will > > call _at least_ one of before-... and after-..., but not necessarily > > both. That doesn't seem sensible to me. > I fully agree that if you only use before-change-functions (or only use > after-change-functions), your hook function should see *all* changes. Taking your parenthetical clause to be an essential part of your sentence, this can only happen if all changes cause both before- and after-change-functions to be called. (A major mode "registering" which one of before- or after- it wishes to see would be ludicrous.) > This is an important property and if there are places where this is not > the case, we should fix them. I agree, it's what I'm proposing and trying to persuade Eli to accept. > > No. A program (such as CC Mode) reacts to a _change_, not merely to > > what a buffer looks like after a change. > But here we have a problem: I don't think that > before/after-change-functions should be always be properly paired, which > IIUC is a property that CC-mode relies on. That appears to contradict your first paragraph. CC Mode does indeed rely on this proper pairing. > Stefan -- Alan Mackenzie (Nuremberg, Germany).