diff lisp/font-lock.el @ 60686:8680359f80e1

(font-lock-lines-before): New user option. (font-lock-after-change-function): Obey it.
author Richard M. Stallman <rms@gnu.org>
date Thu, 17 Mar 2005 23:44:19 +0000
parents 9b15aeb1b3f1
children f36a881a67e2 1830bcd0eec0 30ad2795fdab
line wrap: on
line diff
--- 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)