]> code.delx.au - gnu-emacs/blobdiff - lisp/font-lock.el
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-28
[gnu-emacs] / lisp / font-lock.el
index aa12fb56ba190b643713386a5987a4e5f7d9321a..af1c7619e380e895e5511d5da8aa09fbbe1e868a 100644 (file)
@@ -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")
 \f
 
 ;; 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)