[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
contextual refontification (was: [PATCH] Re: Algorithm in electric-pair-
From: |
Stefan Monnier |
Subject: |
contextual refontification (was: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode) |
Date: |
Tue, 09 Jul 2019 11:40:09 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> * Fontifying "broken" strings only until EOL might be beneficial, at least
> in certain languages, where it's consistent with the syntax. The result will
> be less "blinking".
This problem is not specific to strings: it also affects comments.
BTW, the current default behavior delays re-fontifying the rest of the
buffer (so called "contextual refontification") by jit-lock-context-time
(by default 0.5s) which can sometimes avoid the flashing.
It was not implemented specifically for that purpose, but it does
sometimes have that effect. Maybe we could develop a hack for font-lock
which would do it in a less "accidental" way.
IOW make it so that font-lock:
- delays refontification after the current line if the end of line is
now within a string/comment (and wasn't before).
- "un-delays" this fontification if the end of line is now outside of any
string/comment (but was within it before).
- of course, with some kind of timeout, but one longer than 0.5s.
Or something like that.
Stefan
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, (continued)
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, Stefan Monnier, 2019/07/08
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, Alan Mackenzie, 2019/07/08
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, Stefan Monnier, 2019/07/08
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, Clément Pit-Claudel, 2019/07/09
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, João Távora, 2019/07/09
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, João Távora, 2019/07/09
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, Alan Mackenzie, 2019/07/09
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, João Távora, 2019/07/09
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, João Távora, 2019/07/09
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, Dmitry Gutov, 2019/07/09
- contextual refontification (was: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode),
Stefan Monnier <=
- Re: contextual refontification (was: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode), João Távora, 2019/07/10
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, João Távora, 2019/07/09
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, Alan Mackenzie, 2019/07/09
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, João Távora, 2019/07/09
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, Clément Pit-Claudel, 2019/07/09
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, João Távora, 2019/07/09
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, Clément Pit-Claudel, 2019/07/09
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, João Távora, 2019/07/09
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, João Távora, 2019/07/09
- Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode, Stefan Monnier, 2019/07/09