help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Mode-specific font lock delays


From: Björn Lindqvist
Subject: Re: Mode-specific font lock delays
Date: Sun, 4 Sep 2016 21:12:09 +0200

2016-09-04 15:34 GMT+02:00 Stefan Monnier <monnier@iro.umontreal.ca>:
>> 1) Changing the variable is not mode-specific, but changes how
>> font-lock operates on all buffers. That's not right as I want the
>> increased defer time to only apply to this mode's buffers.
>
> Indeed, it was designed as a (global) user-option, not something decided
> by the major mode.

Perhaps it could be made mode-specific then. :)

>> 2) When a file is opened, there is a flicker as font-lock waits for
>> the timeout before highlighting the buffer. It would be much better if
>> there was no delay for the first highlighting pass.
>
> Hmmm... jit-lock currently doesn't distinguish the "first pass" at all.
> Also I'm not sure if ignoring the jit-lock-defer for the "first pass"
> would result in good behavior for you: it'd be laggy not just when
> displaying the window the first time, but also everytime a new part of
> the buffer becomes visible.

Ah I see. I thought font-lock highlighted the whole buffer when you
opened a file. That it delays highlighting parts of a buffer until you
scroll into it, I didn't know. If there was a way to force font-lock
to highlight the whole buffer I would use that because it doesn't
matter so much if opening buffers takes 300 ms or so more. It's only
when you interact with the buffer that highlighting lag becomes an
issue.

>> Can these two problems be solved?
>
> So far the experience has been that font-lock can be made fast enough
> that those things aren't needed.

These are the font-locking rules for the mode I'm working on:
https://github.com/factor/factor/blob/master/misc/fuel/factor-mode.el#L443
I'm not able to figure out how to make them faster. But if you or
anyone else can I'd be happy. :)


-- 
mvh/best regards Björn Lindqvist



reply via email to

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