Mercurial > emacs
comparison 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 |
comparison
equal
deleted
inserted
replaced
60685:08055baffb97 | 60686:8680359f80e1 |
---|---|
290 If a number, only buffers greater than this size have fontification messages." | 290 If a number, only buffers greater than this size have fontification messages." |
291 :type '(choice (const :tag "never" nil) | 291 :type '(choice (const :tag "never" nil) |
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. |
298 ;; Now we create our own faces, but we keep these variables for compatibility | 304 ;; Now we create our own faces, but we keep these variables for compatibility |
299 ;; and they give users another mechanism for changing face appearance. | 305 ;; and they give users another mechanism for changing face appearance. |
1060 (inhibit-quit t)) | 1066 (inhibit-quit t)) |
1061 (save-excursion | 1067 (save-excursion |
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) |
1069 "Fontify some lines the way `font-lock-fontify-buffer' would. | 1076 "Fontify some lines the way `font-lock-fontify-buffer' would. |
1070 The lines could be a function or paragraph, or a specified number of lines. | 1077 The lines could be a function or paragraph, or a specified number of lines. |