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: Eli Zaretskii
Subject: Re: [PATCH] Re: cc-mode fontification feels random
Date: Tue, 31 Aug 2021 20:02:52 +0300

> Date: Tue, 31 Aug 2021 16:46:15 +0000
> Cc: monnier@iro.umontreal.ca, dancol@dancol.org, emacs-devel@gnu.org
> From: Alan Mackenzie <acm@muc.de>
> 
> > You want to limit the fontification of a chunk to that time, but we
> > don't have an efficient method of doing that, because Emacs is not an
> > interrupt-driven program.
> 
> On my 4 year old HW, approximately 5 CC Mode chunks fit into that time,
> on average.  I think the way to do it is to fontify a chunk at a time,
> and if the 0.05s hasn't yet been used up, fontify another one, and so
> on.

It mostly does, but sometimes doesn't.  We all know that there are
some chunks of C code whose fontification takes a long time.  IME,
this happens frequently enough (judging by the time it sometimes takes
Emacs to respond to a keypress) to be mildly annoying.

> > So if a Lisp program starts some heavy processing, it will only be
> > able to stop when it gets to looking at how much time passed, or tests
> > some flag set by a signal handler.  There can be no guarantee this can
> > never exceed 50 msec.
> 
> No.  But doing a chunk at a time, checking the clock after each chunk,
> will probably be granular enough.

Until you bump into a chunk where it doesn't.

> Again, lets try it and see.

Yes, let's.



reply via email to

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