From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Unbalanced change hooks (part 2) Date: Sun, 31 Jul 2016 14:55:32 -0400 Message-ID: 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 X-Trace: blaine.gmane.org 1469991409 24190 80.91.229.8 (31 Jul 2016 18:56:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 31 Jul 2016 18:56:49 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 31 20:56:36 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 1bTvud-0006Dy-Nm for ged-emacs-devel@m.gmane.org; Sun, 31 Jul 2016 20:56:35 +0200 Original-Received: from localhost ([::1]:40511 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTvuZ-0003Fc-Ox for ged-emacs-devel@m.gmane.org; Sun, 31 Jul 2016 14:56:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTvu2-0003FT-GS for emacs-devel@gnu.org; Sun, 31 Jul 2016 14:55:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTvty-0003dQ-Dc for emacs-devel@gnu.org; Sun, 31 Jul 2016 14:55:57 -0400 Original-Received: from blaine.gmane.org ([80.91.229.8]:39799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTvty-0003dL-64 for emacs-devel@gnu.org; Sun, 31 Jul 2016 14:55:54 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bTvtq-00060F-OM for emacs-devel@gnu.org; Sun, 31 Jul 2016 20:55:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 22 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:eMe8PKnFI8NhfWKI+nvQ3PsWcwE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.91.229.8 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:206280 Archived-At: > 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. This is an important property and if there are places where this is not the case, we should fix them. > 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. Stefan