[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Syntax-ppss flush should happen in after-change hook
From: |
Stefan Monnier |
Subject: |
Re: Syntax-ppss flush should happen in after-change hook |
Date: |
Sat, 16 Mar 2019 18:41:35 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
>> I'd much rather "do it right" and change add-hook to understand a notion of
>> depth/priority/order.
>
> Interesting. This would be useful for this particular case, but are
> there other use cases that would benefit from it?
Since it's proved useful for add-function, I expect it would be useful
for add-hook as well. Off hand, I can only mention
electric--sort-post-self-insertion-hook as a concrete example, tho.
>>> Combine-change-calls happened in my example, but currently any buffer
>>> change results in inconsistent syntax state.
>
>> Then I must have misunderstood something.
>> Can you give more details about the problem scenario you have in mind?
>
> Sorry, I didn't put it rightly. I meant all those functions that
> trigger "syntax-propertize", but looks like I was actually confused
> about the number of such functions.
>
>> It's only when you start using combine-change-calls (or
>> combine-after-change-calls) that the code the performs the change
>> between a-c-f and b-c-f can run arbitrarly fancy Elisp code.
>
> I see. Then, as long as combine-change-calls leaves the correct state
> everything should be fine. Then your patch looks right, indeed.
> It does fix my markdown-mode example for sure.
OK, thanks for testing,
Stefan