aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2010-04-03 16:10:14 -0400
committerStefan Monnier2010-04-03 16:10:14 -0400
commit202ff0d6ee56d743219c01870be24ccc0d14b429 (patch)
treefe6222d31e4c071bf21858445dd0313ec2973f3d
parent0157365cb23163c179f7380f85fb5f693ad0c2f8 (diff)
downloademacs-202ff0d6ee56d743219c01870be24ccc0d14b429.tar.gz
emacs-202ff0d6ee56d743219c01870be24ccc0d14b429.zip
* font-lock.el: Require CL when compiling.
(font-lock-turn-on-thing-lock): Use `case'.
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/font-lock.el39
2 files changed, 28 insertions, 25 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8e40040ad4a..48aed300527 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12010-04-03 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * font-lock.el: Require CL when compiling.
4 (font-lock-turn-on-thing-lock): Use `case'.
5
12010-04-03 Eli Zaretskii <eliz@gnu.org> 62010-04-03 Eli Zaretskii <eliz@gnu.org>
2 7
3 * emacs-lisp/authors.el (authors-fixed-entries): Add entry for Eli 8 * emacs-lisp/authors.el (authors-fixed-entries): Add entry for Eli
@@ -23,11 +28,11 @@
23 * vc-hg.el (vc-hg-push, vc-hg-pull): Use `apply' when calling 28 * vc-hg.el (vc-hg-push, vc-hg-pull): Use `apply' when calling
24 `vc-hg-command' with a list of flags. 29 `vc-hg-command' with a list of flags.
25 30
26 * progmodes/bug-reference.el (bug-reference-bug-regexp): Also 31 * progmodes/bug-reference.el (bug-reference-bug-regexp):
27 accept "patch" and "RFE". 32 Also accept "patch" and "RFE".
28 (bug-reference-fontify): `bug-reference-url-format' can also be a 33 (bug-reference-fontify): `bug-reference-url-format' can also be a
29 function to be able to handle the bug kind. 34 function to be able to handle the bug kind.
30 (turn-on-bug-reference-mode, turn-on-bug-reference-prog-mode): Add 35 (turn-on-bug-reference-mode, turn-on-bug-reference-prog-mode): Add.
31 36
322010-04-02 Jan Djärv <jan.h.d@swipnet.se> 372010-04-02 Jan Djärv <jan.h.d@swipnet.se>
33 38
@@ -36,8 +41,7 @@
36 41
372010-03-31 Chong Yidong <cyd@stupidchicken.com> 422010-03-31 Chong Yidong <cyd@stupidchicken.com>
38 43
39 * cus-edit.el (custom-buffer-sort-alphabetically): Update 44 * cus-edit.el (custom-buffer-sort-alphabetically): Update :version.
40 :version.
41 45
422010-03-31 Juri Linkov <juri@jurta.org> 462010-03-31 Juri Linkov <juri@jurta.org>
43 47
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 0a0499d8db4..7e8562c433a 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -209,6 +209,7 @@
209;;; Code: 209;;; Code:
210 210
211(require 'syntax) 211(require 'syntax)
212(eval-when-compile (require 'cl))
212 213
213;; Define core `font-lock' group. 214;; Define core `font-lock' group.
214(defgroup font-lock '((jit-lock custom-group)) 215(defgroup font-lock '((jit-lock custom-group))
@@ -902,26 +903,24 @@ The value of this variable is used when Font Lock mode is turned on."
902(declare-function lazy-lock-mode "lazy-lock") 903(declare-function lazy-lock-mode "lazy-lock")
903 904
904(defun font-lock-turn-on-thing-lock () 905(defun font-lock-turn-on-thing-lock ()
905 (let ((thing-mode (font-lock-value-in-major-mode font-lock-support-mode))) 906 (case (font-lock-value-in-major-mode font-lock-support-mode)
906 (cond ((eq thing-mode 'fast-lock-mode) 907 (fast-lock-mode (fast-lock-mode t))
907 (fast-lock-mode t)) 908 (lazy-lock-mode (lazy-lock-mode t))
908 ((eq thing-mode 'lazy-lock-mode) 909 (jit-lock-mode
909 (lazy-lock-mode t)) 910 ;; Prepare for jit-lock
910 ((eq thing-mode 'jit-lock-mode) 911 (remove-hook 'after-change-functions
911 ;; Prepare for jit-lock 912 'font-lock-after-change-function t)
912 (remove-hook 'after-change-functions 913 (set (make-local-variable 'font-lock-fontify-buffer-function)
913 'font-lock-after-change-function t) 914 'jit-lock-refontify)
914 (set (make-local-variable 'font-lock-fontify-buffer-function) 915 ;; Don't fontify eagerly (and don't abort if the buffer is large).
915 'jit-lock-refontify) 916 (set (make-local-variable 'font-lock-fontified) t)
916 ;; Don't fontify eagerly (and don't abort if the buffer is large). 917 ;; Use jit-lock.
917 (set (make-local-variable 'font-lock-fontified) t) 918 (jit-lock-register 'font-lock-fontify-region
918 ;; Use jit-lock. 919 (not font-lock-keywords-only))
919 (jit-lock-register 'font-lock-fontify-region 920 ;; Tell jit-lock how we extend the region to refontify.
920 (not font-lock-keywords-only)) 921 (add-hook 'jit-lock-after-change-extend-region-functions
921 ;; Tell jit-lock how we extend the region to refontify. 922 'font-lock-extend-jit-lock-region-after-change
922 (add-hook 'jit-lock-after-change-extend-region-functions 923 nil t))))
923 'font-lock-extend-jit-lock-region-after-change
924 nil t)))))
925 924
926(defun font-lock-turn-off-thing-lock () 925(defun font-lock-turn-off-thing-lock ()
927 (cond ((bound-and-true-p fast-lock-mode) 926 (cond ((bound-and-true-p fast-lock-mode)