# HG changeset patch # User Richard M. Stallman # Date 1111103059 0 # Node ID 8680359f80e189ea8359d6c48d364d008e7298f3 # Parent 08055baffb977a006830bbc9f07cdf80ac5f40d1 (font-lock-lines-before): New user option. (font-lock-after-change-function): Obey it. diff -r 08055baffb97 -r 8680359f80e1 lisp/font-lock.el --- a/lisp/font-lock.el Thu Mar 17 23:43:17 2005 +0000 +++ b/lisp/font-lock.el Thu Mar 17 23:44:19 2005 +0000 @@ -292,6 +292,12 @@ (other :tag "always" t) (integer :tag "size")) :group 'font-lock) + +(defcustom font-lock-lines-before 1 + "*Number of lines before the changed text to include in refontification." + :type 'integer + :group 'font-lock + :version "22.1") ;; Originally these variable values were face names such as `bold' etc. @@ -1062,7 +1068,8 @@ (save-match-data ;; Rescan between start of lines enclosing the region. (font-lock-fontify-region - (progn (goto-char beg) (beginning-of-line) (point)) + (progn (goto-char beg) + (forward-line (- font-lock-lines-before)) (point)) (progn (goto-char end) (forward-line 1) (point))))))) (defun font-lock-fontify-block (&optional arg)