all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Mode-specific font lock delays
@ 2016-09-04  5:01 Björn Lindqvist
  2016-09-04 13:34 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Björn Lindqvist @ 2016-09-04  5:01 UTC (permalink / raw)
  To: help-gnu-emacs

Hello emacsers!

In the mode I'm working on, font locking is getting laggy when
operating on large buffers. Possibly because the regexps I've written
for highlighting aren't very good and could use some tune-up by some
experts. But it is quick enough for most buffers. So what I'm looking
for is a way to defer font-locking so that it only occurs when nothing
else is happening which should prevent emacs from becoming laggy.

I've found a few variables in the jit-lock-* namespace which I've
tried to tweak. What I've found worked the best was setting
jit-lock-defer-time to a value like 0.5-1.5 which completely
eliminates all lag. But there are two problems:

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.
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.

Can these two problems be solved? If so, how? It would be nice if
font-lock had some builtin auto-tuning so that if it notices that if
the highlighting passes are taking a long time to run, it increases
the delay between them.


-- 
mvh/best regards Björn Lindqvist



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-05  2:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-04  5:01 Mode-specific font lock delays Björn Lindqvist
2016-09-04 13:34 ` Stefan Monnier
2016-09-04 19:12   ` Björn Lindqvist
2016-09-05  2:51     ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.