aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-03-17 23:44:19 +0000
committerRichard M. Stallman2005-03-17 23:44:19 +0000
commitf9d0b1eda13de6f3f3a4ea1fd4f0bdc7b214d414 (patch)
tree044c6c1df6c4a14ca615257057519c4b3dc3b5d4
parent231717ee730702ef5a0b960506389937cc31e72f (diff)
downloademacs-f9d0b1eda13de6f3f3a4ea1fd4f0bdc7b214d414.tar.gz
emacs-f9d0b1eda13de6f3f3a4ea1fd4f0bdc7b214d414.zip
(font-lock-lines-before): New user option.
(font-lock-after-change-function): Obey it.
-rw-r--r--lisp/font-lock.el9
1 files changed, 8 insertions, 1 deletions
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."
292 (other :tag "always" t) 292 (other :tag "always" t)
293 (integer :tag "size")) 293 (integer :tag "size"))
294 :group 'font-lock) 294 :group 'font-lock)
295
296(defcustom font-lock-lines-before 1
297 "*Number of lines before the changed text to include in refontification."
298 :type 'integer
299 :group 'font-lock
300 :version "22.1")
295 301
296 302
297;; Originally these variable values were face names such as `bold' etc. 303;; Originally these variable values were face names such as `bold' etc.
@@ -1062,7 +1068,8 @@ what properties to clear before refontifying a region.")
1062 (save-match-data 1068 (save-match-data
1063 ;; Rescan between start of lines enclosing the region. 1069 ;; Rescan between start of lines enclosing the region.
1064 (font-lock-fontify-region 1070 (font-lock-fontify-region
1065 (progn (goto-char beg) (beginning-of-line) (point)) 1071 (progn (goto-char beg)
1072 (forward-line (- font-lock-lines-before)) (point))
1066 (progn (goto-char end) (forward-line 1) (point))))))) 1073 (progn (goto-char end) (forward-line 1) (point)))))))
1067 1074
1068(defun font-lock-fontify-block (&optional arg) 1075(defun font-lock-fontify-block (&optional arg)