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



_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to