emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unbalanced change hooks (part 2)


From: Stefan Monnier
Subject: Re: Unbalanced change hooks (part 2)
Date: Mon, 01 Aug 2016 09:01:16 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

>> > 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]