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

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

Re: Defer jit-lock on a per-buffer basis


From: Tassilo Horn
Subject: Re: Defer jit-lock on a per-buffer basis
Date: Thu, 15 Nov 2012 19:28:05 +0100
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> So is there a way to enable deferred jit-lock on a per-buffer basis?
>
> Not without rewriting the JIT Lock code, I think.  JIT Lock goes over
> all of the buffers with the same timers, so any option you customize
> will affect all of the buffers.

Right, so why not simply making the timers buffer-local, too?  I've
tried that

--8<---------------cut here---------------start------------->8---
(defun th-jit-lock-defer-fontification ()
  (interactive)
  (make-local-variable 'jit-lock-stealth-timer)
  (make-local-variable 'jit-lock-stealth-repeat-timer)
  (make-local-variable 'jit-lock-context-timer)
  (make-local-variable 'jit-lock-defer-timer)
  (set (make-local-variable 'jit-lock-defer-time) 0.1)
  (font-lock-mode -1)
  (font-lock-mode 1))
--8<---------------cut here---------------end--------------->8---

and it seems to work exactly as expected. :-)

Thanks,
Tassilo




reply via email to

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