From: Richard M. Stallman Date: Thu, 17 Mar 2005 23:44:19 +0000 (+0000) Subject: (font-lock-lines-before): New user option. X-Git-Tag: ttn-vms-21-2-B4~1736 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f9d0b1eda13de6f3f3a4ea1fd4f0bdc7b214d414;p=emacs.git (font-lock-lines-before): New user option. (font-lock-after-change-function): Obey it. --- diff --git a/lisp/font-lock.el b/lisp/font-lock.el index ceadcf19728..2a050c9637e 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -292,6 +292,12 @@ If a number, only buffers greater than this size have fontification messages." (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 @@ what properties to clear before refontifying a region.") (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)