emacs-devel
[Top][All Lists]
Advanced

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

jit-lock doesn't honor font-lock-lines-before


From: martin rudalics
Subject: jit-lock doesn't honor font-lock-lines-before
Date: Sun, 28 Aug 2005 15:08:59 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

The customizable variable `font-lock-lines-before' is not honored by
jit-lock mode.  That's irritating since jit-lock is turned on by default
and other font-lock variables _are_ respected when jit-lock is active.

Below find two proposals:

(1) Preserve the current state of affairs and provide the appropriate
    hints in the doc-string:

(defcustom font-lock-lines-before 1
  "*Number of lines before the changed text to include in refontification.

This variable is not considered by `jit-lock-mode' and other Font lock
support modes."
  :type 'integer
  :group 'font-lock
  :version "22.1")

    and the Elisp manual (which doesn't mention jit-lock so far):

 -- Variable: font-lock-lines-before
     This variable specifies the number of extra lines to consider when
     refontifying the buffer after each text change.  Font lock begins
     refontifying from that number of lines before the changed region.
     The default is 1, but using a larger value can be useful for
     coping with multi-line patterns.  This variable is not considered
     by `jit-lock-mode' and other Font lock support modes.

(2) Modify `jit-lock-after-change' appropriately by, for example, inserting

       (forward-line (- font-lock-lines-before))

    before

       (setq start (line-beginning-position))

I prefer proposal (1).





reply via email to

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