aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2006-03-15 22:26:09 +0000
committerStefan Monnier2006-03-15 22:26:09 +0000
commit4ffc92c2d8cffb5a8ed984bd2556ff7b124ccb0a (patch)
tree5380bc5eba8af29d5f8f4d9f028e0ff2ee4d8b8d
parent364d0cf80549428a8e1f880eab13e73e67cbdd69 (diff)
downloademacs-4ffc92c2d8cffb5a8ed984bd2556ff7b124ccb0a.tar.gz
emacs-4ffc92c2d8cffb5a8ed984bd2556ff7b124ccb0a.zip
* font-lock.el (font-lock-lines-before): Delete variable, subsumed by
the new extend-region feature. (font-lock-after-change-function): Update correspondingly. * jit-lock.el (jit-lock-after-change): Update correspondingly. * progmodes/grep.el (font-lock-lines-before): Don't disable. * modes.texi (Region to Fontify): Remove font-lock-lines-before.
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/font-lock.el11
-rw-r--r--lisp/jit-lock.el2
-rw-r--r--lisp/progmodes/grep.el7
-rw-r--r--lispref/ChangeLog16
-rw-r--r--lispref/modes.texi10
7 files changed, 22 insertions, 37 deletions
diff --git a/etc/NEWS b/etc/NEWS
index b7d93fe51bb..d273654500c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -873,11 +873,6 @@ fontification in Info, remove `turn-on-font-lock' from
873`Info-mode-hook'. 873`Info-mode-hook'.
874 874
875+++ 875+++
876*** font-lock-lines-before specifies a number of lines before the
877current line that should be refontified when you change the buffer.
878The default value is 1.
879
880+++
881*** font-lock: in modes like C and Lisp where the fontification assumes that 876*** font-lock: in modes like C and Lisp where the fontification assumes that
882an open-paren in column 0 is always outside of any string or comment, 877an open-paren in column 0 is always outside of any string or comment,
883font-lock now highlights any such open-paren-in-column-zero in bold-red 878font-lock now highlights any such open-paren-in-column-zero in bold-red
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ea75ff76f44..840fef7fb81 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12006-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * font-lock.el (font-lock-lines-before): Delete variable, subsumed by
4 the new extend-region feature.
5 (font-lock-after-change-function): Update correspondingly.
6 * jit-lock.el (jit-lock-after-change): Update correspondingly.
7 * progmodes/grep.el (font-lock-lines-before): Don't disable.
8
12006-03-15 Bill Wohler <wohler@newt.com> 92006-03-15 Bill Wohler <wohler@newt.com>
2 10
3 * image.el (image-load-path-for-library): Fix example by not 11 * image.el (image-load-path-for-library): Fix example by not
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index bae492509ec..d3017e3b3f3 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -281,12 +281,6 @@ If a number, only buffers greater than this size have fontification messages."
281 (other :tag "always" t) 281 (other :tag "always" t)
282 (integer :tag "size")) 282 (integer :tag "size"))
283 :group 'font-lock) 283 :group 'font-lock)
284
285(defcustom font-lock-lines-before 0
286 "*Number of lines before the changed text to include in refontification."
287 :type 'integer
288 :group 'font-lock
289 :version "22.1")
290 284
291 285
292;; Originally these variable values were face names such as `bold' etc. 286;; Originally these variable values were face names such as `bold' etc.
@@ -1098,9 +1092,8 @@ what properties to clear before refontifying a region.")
1098 ;; Fontify the region the major mode has specified. 1092 ;; Fontify the region the major mode has specified.
1099 (setq beg (car region) end (cdr region)) 1093 (setq beg (car region) end (cdr region))
1100 ;; Fontify the whole lines which enclose the region. 1094 ;; Fontify the whole lines which enclose the region.
1101 (setq beg (progn (goto-char beg) 1095 (setq beg (progn (goto-char beg) (line-beginning-position))
1102 (forward-line (- font-lock-lines-before))) 1096 end (progn (goto-char end) (line-beginning-position 2))))
1103 end (progn (goto-char end) (forward-line 1) (point))))
1104 (font-lock-fontify-region beg end))))) 1097 (font-lock-fontify-region beg end)))))
1105 1098
1106(defun font-lock-fontify-block (&optional arg) 1099(defun font-lock-fontify-block (&optional arg)
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index f82ead462f0..84e0dc0cab3 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -571,7 +571,7 @@ will take place when text is fontified stealthily."
571 (setq start (if region 571 (setq start (if region
572 (car region) 572 (car region)
573 (goto-char start) 573 (goto-char start)
574 (line-beginning-position (- 1 font-lock-lines-before)))) 574 (line-beginning-position)))
575 575
576 ;; If we're in text that matches a multi-line font-lock pattern, 576 ;; If we're in text that matches a multi-line font-lock pattern,
577 ;; make sure the whole text will be redisplayed. 577 ;; make sure the whole text will be redisplayed.
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 0e151ce9be2..6afa3f29348 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -33,8 +33,6 @@
33 33
34(require 'compile) 34(require 'compile)
35 35
36(defvar font-lock-lines-before)
37
38 36
39(defgroup grep nil 37(defgroup grep nil
40 "Run compiler as inferior of Emacs, parse error messages." 38 "Run compiler as inferior of Emacs, parse error messages."
@@ -536,10 +534,7 @@ temporarily highlight in visited source lines."
536 grep-regexp-alist) 534 grep-regexp-alist)
537 (set (make-local-variable 'compilation-process-setup-function) 535 (set (make-local-variable 'compilation-process-setup-function)
538 'grep-process-setup) 536 'grep-process-setup)
539 (set (make-local-variable 'compilation-disable-input) t) 537 (set (make-local-variable 'compilation-disable-input) t))
540 ;; Set `font-lock-lines-before' to 0 to not refontify the previous
541 ;; line where grep markers may be already removed.
542 (set (make-local-variable 'font-lock-lines-before) 0))
543 538
544;;;###autoload 539;;;###autoload
545(defun grep-find (command-args) 540(defun grep-find (command-args)
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 70df1ae03f4..1ea4a73365c 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,7 @@
12006-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * modes.texi (Region to Fontify): Remove font-lock-lines-before.
4
12006-03-15 Bill Wohler <wohler@newt.com> 52006-03-15 Bill Wohler <wohler@newt.com>
2 6
3 * display.texi (Defining Images): Fix example in 7 * display.texi (Defining Images): Fix example in
@@ -14,7 +18,7 @@
14 18
15 * modes.texi: New node, "Region to Fontify" (for Font Lock). 19 * modes.texi: New node, "Region to Fontify" (for Font Lock).
16 This describes font-lock-extend-region-function. 20 This describes font-lock-extend-region-function.
17 ("Other Font Lock Variables"): move "font-lock-lines-before" to 21 ("Other Font Lock Variables"): Move "font-lock-lines-before" to
18 the new node "Region to Fontify". 22 the new node "Region to Fontify".
19 23
202006-03-13 Richard Stallman <rms@gnu.org> 242006-03-13 Richard Stallman <rms@gnu.org>
@@ -111,9 +115,9 @@
111 115
1122006-02-16 Johan Bockg,Ae(Brd <bojohan@dd.chalmers.se> 1162006-02-16 Johan Bockg,Ae(Brd <bojohan@dd.chalmers.se>
113 117
114 * display.texi (Other Display Specs, Image Descriptors): Revert 118 * display.texi (Other Display Specs, Image Descriptors):
115 erroneous changes. The previous description of image-descriptors 119 Revert erroneous changes. The previous description of
116 as `(image . PROPS)' was correct. 120 image-descriptors as `(image . PROPS)' was correct.
117 121
1182006-02-14 Richard M. Stallman <rms@gnu.org> 1222006-02-14 Richard M. Stallman <rms@gnu.org>
119 123
@@ -164,8 +168,8 @@
164 168
1652006-01-29 Chong Yidong <cyd@stupidchicken.com> 1692006-01-29 Chong Yidong <cyd@stupidchicken.com>
166 170
167 * display.texi (Other Display Specs, Image Descriptors): Image 171 * display.texi (Other Display Specs, Image Descriptors):
168 description is a list, not a cons cell. 172 Image description is a list, not a cons cell.
169 173
1702006-01-28 Luc Teirlinck <teirllm@auburn.edu> 1742006-01-28 Luc Teirlinck <teirllm@auburn.edu>
171 175
diff --git a/lispref/modes.texi b/lispref/modes.texi
index e15392ac85a..fc1953d24d9 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -2731,16 +2731,6 @@ on an earlier line.
2731You can enlarge (or even reduce) the region to fontify by setting either 2731You can enlarge (or even reduce) the region to fontify by setting either
2732of the following variables: 2732of the following variables:
2733 2733
2734@defvar font-lock-lines-before
2735This variable specifies the number of extra lines to consider when
2736refontifying the buffer after each text change. Font lock begins
2737refontifying from that number of lines before the changed region. The
2738default is 0, but using a larger value can be useful for coping with
2739multi-line patterns. This variable is ignored whenever
2740@code{font-lock-extend-region-function} is set and returns a
2741non-@code{nil} value.
2742@end defvar
2743
2744@defvar font-lock-extend-region-function 2734@defvar font-lock-extend-region-function
2745This buffer-local variable is either @code{nil} or is a function that 2735This buffer-local variable is either @code{nil} or is a function that
2746determines the region to fontify, which Emacs then calls after each 2736determines the region to fontify, which Emacs then calls after each