From: Tassilo Horn <tsdh@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Defer jit-lock on a per-buffer basis
Date: Thu, 15 Nov 2012 10:29:56 +0100 [thread overview]
Message-ID: <87r4nvmcx7.fsf@thinkpad.tsdh.de> (raw)
Hi all,
recently this blog post
http://tsengf.blogspot.de/2012/11/slow-scrolling-speed-in-emacs.html
suggested to set `jit-lock-defer-time' to some small fraction to defer
jit-lock fontification a bit. This has an enormous effect for example
when scrolling in large c-mode buffers.
However, most of the time I work with buffers that are rather small and
instant fontification is fast enough. There, deferring font-lock is
somewhat distracting.
So is there a way to enable deferred jit-lock on a per-buffer basis?
I tried this:
(defun th-jit-lock-defer-fontification ()
(interactive)
(set (make-local-variable 'jit-lock-defer-time) 0.1)
(font-lock-mode -1)
(font-lock-mode 1))
In fact, when I execute that command, the variable is buffer-local, and
jit-lock is deferred as it should. But it is actually deferred in *all*
buffers! Even disabling and re-enabling font-lock-mode in a buffer that
doesn't have a buffer-local value of `jit-lock-defer-time' doesn't make
fontification instant again...
Any ideas?
Bye,
Tassilo
next reply other threads:[~2012-11-15 9:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-15 9:29 Tassilo Horn [this message]
2012-11-15 16:55 ` Defer jit-lock on a per-buffer basis Eli Zaretskii
2012-11-15 18:28 ` Tassilo Horn
[not found] <mailman.13022.1352971819.855.help-gnu-emacs@gnu.org>
2012-11-15 20:38 ` 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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r4nvmcx7.fsf@thinkpad.tsdh.de \
--to=tsdh@gnu.org \
--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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).