emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Re: cc-mode fontification feels random


From: Daniel Colascione
Subject: Re: [PATCH] Re: cc-mode fontification feels random
Date: Mon, 30 Aug 2021 12:28:01 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 8/30/21 12:25 PM, Eli Zaretskii wrote:
Date: Mon, 30 Aug 2021 18:50:34 +0000
From: Alan Mackenzie <acm@muc.de>
Cc: emacs-devel@gnu.org

The following patch is an attempt to improve this situation.  It is best
used with jit-stealth-lock enabled.  I have tried it out with the
following settings:

     jit-lock-stealth-load: 200 ; i.e. inactive.
     jit-lock-stealth-nice: 0.1 ; 100 ms between fontifying stealth
                                  chunks.
     jit-lock-stealth-time: 1   ; 1 second idle time before stealth kicks
                                  in.

Whenever a new found type is entered into the CC Mode table, it marks
all occurrences of the type in the buffer for fontification (by setting
the 'fontified text property to nil on it), and causes an immediate
redisplay when there are occurrences of the new type in a window.
So you are saying that this will cause the display of the visible
portion of the window to flicker whenever jit-lock-stealth finds such
a "new type"?  That could annoy, can't it?  jit-lock-stealth is for
fontifying portions of the buffer(s) that are not on display, it would
be wrong for it to apply this enhancement, I think, certainly by
default.

Any literal "flicker" issues should have been fixed for a long time now. What do you mean? That the fontification might change? That happens anyway.



And jit-lock-stealth-time of 1 sec is too short.  I use 16, because
once jit-lock-stealth starts fontifying a chunk, Emacs can be
relatively slow to react to keyboard input, so I prefer to let
jit-lock-stealth start its thing only when there's a very good chance
I indeed stopped typing, not just thinking about something for a
second or two.

Isn't this problem what while-no-input is intended to prevent?

I think stealth lock could be enhanced by having it fontify several
500-byte chunks together, say until 0.05s time has been taken up.  This
could speed up stealth fontification while still leaving the keyboard
responsive to the user.
Users can already arrange for that by manipulating the
jit-stealth-lock parameters.  Why should we change code to force upon
everyone what seems like a good idea to you (but isn't a good idea
IME, see above)?  If you want that, you can easily arrange for Emacs
to behave like that without changing any code.

Because good defaults matter, and if we have proper input preemption of stealth JIT working, there should be no downside.





reply via email to

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