Message from discussion
Defer jit-lock on a per-buffer basis
Received: by 10.66.72.134 with SMTP id d6mr77854pav.20.1352971820626;
Thu, 15 Nov 2012 01:30:20 -0800 (PST)
Path: 6ni82676pbd.1!nntp.google.com!news.glorb.com!usenet.stanford.edu!not-for-mail
From: Tassilo Horn <t...@gnu.org>
Newsgroups: gnu.emacs.help
Subject: Defer jit-lock on a per-buffer basis
Date: Thu, 15 Nov 2012 10:29:56 +0100
Lines: 36
Approved: help-gnu-em...@gnu.org
Message-ID: <mailman.13022.1352971819.855.help-gnu-emacs@gnu.org>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0
X-Trace: usenet.stanford.edu 1352971820 21389 208.118.235.17 (15 Nov 2012 09:30:20 GMT)
X-Complaints-To: action@cs.stanford.edu
To: help-gnu-em...@gnu.org
Envelope-to: help-gnu-em...@gnu.org
X-Injected-Via-Gmane: http://gmane.org/
X-Gmane-NNTP-Posting-Host: tsdh.uni-koblenz.de
User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)
Cancel-Lock: sha1:UXduF43muDdWxJ0P2iLuGTIli7I=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 80.91.229.3
X-BeenThere: help-gnu-em...@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-gnu-emacs>,
<mailto:help-gnu-emacs-requ...@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-gnu-emacs>
List-Post: <mailto:help-gnu-em...@gnu.org>
List-Help: <mailto:help-gnu-emacs-requ...@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-gnu-emacs>,
<mailto:help-gnu-emacs-requ...@gnu.org?subject=subscribe>
Content-Type: text/plain
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