Subject: Re: bug#18826: 24.3.94; c++-mode bad indentation after programmatic insert with locally changed syntax table

From: Stefan Monnier <[email-masked]>
Date: Sun, 26 Oct 2014 13:07:24 -0400

> On the other hand, you're doing some pretty unusual things with this.
> If `c-in-sws' and `c-is-sws' were added in syntax-propertize-function
> (which is called on-demand), this conflict wouldn't have manifested.

;-)

> In that sense, the `sit-for' suggestion is not future-proof.  So I'll try
> only changing the syntax table around specific functions that don't modify
> the buffer text, but just move point, since that was the actual goal.

Rather than using a hack like `sit-for', and while waiting for cc-mode
to use syntax-propertize for that, you can use `font-lock-ensure' to
make sure that the corresponding part of the code has been font-locked.

        Stefan