Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Defer jit-lock on a per-buffer basis
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tassilo Horn  
View profile  
 More options Nov 15 2012, 4:30 am
Newsgroups: gnu.emacs.help
From: Tassilo Horn <t...@gnu.org>
Date: Thu, 15 Nov 2012 10:29:56 +0100
Local: Thurs, Nov 15 2012 4:29 am
Subject: Defer jit-lock on a per-buffer basis
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli Zaretskii  
View profile  
 More options Nov 15 2012, 11:55 am
Newsgroups: gnu.emacs.help
From: Eli Zaretskii <e...@gnu.org>
Date: Thu, 15 Nov 2012 18:55:32 +0200
Local: Thurs, Nov 15 2012 11:55 am
Subject: Re: Defer 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.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tassilo Horn  
View profile  
 More options Nov 15 2012, 1:28 pm
Newsgroups: gnu.emacs.help
From: Tassilo Horn <t...@gnu.org>
Date: Thu, 15 Nov 2012 19:28:05 +0100
Local: Thurs, Nov 15 2012 1:28 pm
Subject: Re: Defer jit-lock on a per-buffer basis

Eli Zaretskii <e...@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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Monnier  
View profile  
 More options Nov 15 2012, 3:38 pm
Newsgroups: gnu.emacs.help
From: Stefan Monnier <monn...@iro.umontreal.ca>
Date: Thu, 15 Nov 2012 15:38:27 -0500
Local: Thurs, Nov 15 2012 3:38 pm
Subject: Re: Defer jit-lock on a per-buffer basis

> 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.

FWIW, you can argue that it's a bug in the c-mode.

        Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »