all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Björn Lindqvist" <bjourne@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Mode-specific font lock delays
Date: Sun, 4 Sep 2016 07:01:42 +0200	[thread overview]
Message-ID: <CALG+76eqfNhgS6NhD98tFf3OVCUx4Nm+=NG2GCW9QxYu7hVP8w@mail.gmail.com> (raw)

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



             reply	other threads:[~2016-09-04  5:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-04  5:01 Björn Lindqvist [this message]
2016-09-04 13:34 ` Mode-specific font lock delays Stefan Monnier
2016-09-04 19:12   ` Björn Lindqvist
2016-09-05  2:51     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALG+76eqfNhgS6NhD98tFf3OVCUx4Nm+=NG2GCW9QxYu7hVP8w@mail.gmail.com' \
    --to=bjourne@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.