[Top][All Lists]

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

Re: C-n is very slow in Font-Lock mode

From: Eli Zaretskii
Subject: Re: C-n is very slow in Font-Lock mode
Date: Sat, 23 Apr 2005 23:17:03 +0300

> From: Richard Stallman <address@hidden>
> Date: Sat, 23 Apr 2005 12:16:35 -0400
> With Font-Lock mode enabled, starting from the beginning of a large
> file (such as fileio.c), C-n with a large argument (I tried C-u 2536
> C-n) took many seconds.  I think it was fontifying all the text
> that it moved across.

Probably.  JIT lock fontifies any portion of a buffer that is becoming
visible, and C-n makes visible all parts of the buffer it moves
across, one page at a time.

> Can this be avoided?  I don't think C-n ought to need to fontify
> all that text.

Try setting jit-lock-defer-time to a non-nil value.

Anyway, C-n is a very inefficient method of paging through a buffer.
If you want to move 2536 lines, you will be better off using goto-line
or C-v.  JIT lock is optimized for C-v and similar methods that page
by large chunks of text rather than by one line.

> Even once it has fontified, the command still takes a lot longer
> with Font-Lock mode enabled than it does with Font-Lock disabled.

I'm guessing this is because the display engine looks up all the text
properties put on the text by font-lock.

reply via email to

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