all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Defer jit-lock on a per-buffer basis
@ 2012-11-15  9:29 Tassilo Horn
  2012-11-15 16:55 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Tassilo Horn @ 2012-11-15  9:29 UTC (permalink / raw
  To: help-gnu-emacs

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




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

end of thread, other threads:[~2012-11-15 20:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.13022.1352971819.855.help-gnu-emacs@gnu.org>
2012-11-15 20:38 ` Defer jit-lock on a per-buffer basis Stefan Monnier
2012-11-15  9:29 Tassilo Horn
2012-11-15 16:55 ` Eli Zaretskii
2012-11-15 18:28   ` Tassilo Horn

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.