[Top][All Lists]

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

Re: Fontifying unterminated strings [was: CC Mode and electric-pair "pro

From: Stefan Monnier
Subject: Re: Fontifying unterminated strings [was: CC Mode and electric-pair "problem".]
Date: Thu, 28 Jun 2018 20:43:40 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> My suggestion has no "string-fence syntax-table" or any such thing, so
> I'm not sure what you're saying here.
> Before suggesting something else, could you clarify the downside you see
> with my proposal?

Hmm... sorry: I'm catching up with some mail backlog and didn't read
carefully.  I noticed too late that I misread: your message was not in
reply to my last suggestion but to some earlier discussion.  So, please
disregard the above text.

I'll finish reading my mail before replying further.

I think the following part of my answer is still correct, tho maybe
out-of-date with subsequent discussion I'm about to discover.


>> (ii) we amend font-{lock,core}.el to apply the desired fontification, to
>>   be like the new fontification in CC Mode?
> This problem is not specific to C but it's not common to all programming
> languages either, so I think that modifying font-(lock|core).el
> for that would be a gross hack.
> We could do it somewhat cleanly by having font-lock.el provide some
> "standard" function that major modes could opt to use in their
> font-lock-* settings, of course, but I'm having a hard time imagining
> a solution with a nice semantics on that side: if we do it only by
> tweaking faces, then we get inconsistent behavior between highlighting
> and C-M-f, and if we do it by tweaking syntax-tables, then we get weird
> differences between the case where font-lock is used and where it's not
> used (e.g. between not-yet-displayed code and already displayed code, or
> between the case where font-lock-mode is enabled or not).
> `syntax-table` properties should be applied via
> syntax-propertize-function in order to be reliably available.
>         Stefan

reply via email to

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