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: Mon, 01 Aug 2016 09:01:16 -0400 Message-ID: References: <20160731121642.GB2205@acm.fritz.box> <83a8gxq288.fsf@gnu.org> <20160731172804.GD2205@acm.fritz.box> <834m75ptij.fsf@gnu.org> <20160731212635.GF2205@acm.fritz.box> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1470056389 12303 80.91.229.8 (1 Aug 2016 12:59:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 1 Aug 2016 12:59: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 Mon Aug 01 14:59: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 1bUCof-0002pz-QO for ged-emacs-devel@m.gmane.org; Mon, 01 Aug 2016 14:59:33 +0200 Original-Received: from localhost ([::1]:50101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUCoc-0006Du-1t for ged-emacs-devel@m.gmane.org; Mon, 01 Aug 2016 08:59:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUCoQ-0006DA-9V for emacs-devel@gnu.org; Mon, 01 Aug 2016 08:59:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUCoM-0002YP-Ar for emacs-devel@gnu.org; Mon, 01 Aug 2016 08:59:18 -0400 Original-Received: from blaine.gmane.org ([80.91.229.8]:45942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUCoM-0002XQ-3r for emacs-devel@gnu.org; Mon, 01 Aug 2016 08:59:14 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bUCoE-0002C0-3l for emacs-devel@gnu.org; Mon, 01 Aug 2016 14:59:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 45 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:BsvS3aA/GcDYG0TpGmzy1X2WPMM= 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:206302 Archived-At: >> > As a concrete example of this, suppose we have this in a buffer: >> > >> > #define foo() first line \ >> > second line \ >> > third line \ >> > fourth line >> > >> > , and the change consists of deleting the backslash on L2. >> > before-change-functions will have noted that all four lines are in the >> > "active area". after-change-functions unassisted would merely see that >> > the "active area" consists of L1 and L2. The info from before-change >> > enables after-change to operate on the entire four lines. I think this can work at one condition: you need to make sure that it also works if you get something like: b-c-f called on L2 b-c-f called on L37 a-c-f called on L2-L37 or b-c-f called on L2 b-c-f called on L37 a-c-f called on L2 a-c-f called on L37 or b-c-f called on L2-L3 a-c-f called on L2 a-c-f called on L3 and other such variations. > I'm not saying that CC Mode couldn't be redesigned not to use > before-change-functions, but it would be a massive amount of work which > wouldn't get us any closer to where we want CC Mode to be, and it would > be depressing unrewarding work. Switching to use syntax-propertize would likely solve this problem along with various others and would be very rewarding. Stefan