]> git.eshelyaron.com Git - emacs.git/commitdiff
* font-lock.el: Require CL when compiling.
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 3 Apr 2010 20:10:14 +0000 (16:10 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 3 Apr 2010 20:10:14 +0000 (16:10 -0400)
(font-lock-turn-on-thing-lock): Use `case'.

lisp/ChangeLog
lisp/font-lock.el

index 8e40040ad4aecc96ef38f50afa5daf5694a2901c..48aed300527521bef898bf29c60985c48d17921d 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * font-lock.el: Require CL when compiling.
+       (font-lock-turn-on-thing-lock): Use `case'.
+
 2010-04-03  Eli Zaretskii  <eliz@gnu.org>
 
        * emacs-lisp/authors.el (authors-fixed-entries): Add entry for Eli
        * vc-hg.el (vc-hg-push, vc-hg-pull): Use `apply' when calling
        `vc-hg-command' with a list of flags.
 
-       * progmodes/bug-reference.el (bug-reference-bug-regexp): Also
-       accept "patch" and "RFE".
+       * progmodes/bug-reference.el (bug-reference-bug-regexp):
+       Also accept "patch" and "RFE".
        (bug-reference-fontify): `bug-reference-url-format' can also be a
        function to be able to handle the bug kind.
-       (turn-on-bug-reference-mode, turn-on-bug-reference-prog-mode): Add
+       (turn-on-bug-reference-mode, turn-on-bug-reference-prog-mode): Add.
 
 2010-04-02  Jan Djärv  <jan.h.d@swipnet.se>
 
@@ -36,8 +41,7 @@
 
 2010-03-31  Chong Yidong  <cyd@stupidchicken.com>
 
-       * cus-edit.el (custom-buffer-sort-alphabetically): Update
-       :version.
+       * cus-edit.el (custom-buffer-sort-alphabetically): Update :version.
 
 2010-03-31  Juri Linkov  <juri@jurta.org>
 
index 0a0499d8db4022b5b2a8dddb15a9e2d36e9a7ab1..7e8562c433a528a91ac7a88874d33eaebeed61f8 100644 (file)
 ;;; Code:
 
 (require 'syntax)
+(eval-when-compile (require 'cl))
 
 ;; Define core `font-lock' group.
 (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."
 (declare-function lazy-lock-mode "lazy-lock")
 
 (defun font-lock-turn-on-thing-lock ()
-  (let ((thing-mode (font-lock-value-in-major-mode font-lock-support-mode)))
-    (cond ((eq thing-mode 'fast-lock-mode)
-          (fast-lock-mode t))
-         ((eq thing-mode 'lazy-lock-mode)
-          (lazy-lock-mode t))
-         ((eq thing-mode 'jit-lock-mode)
-          ;; Prepare for jit-lock
-          (remove-hook 'after-change-functions
-                       'font-lock-after-change-function t)
-          (set (make-local-variable 'font-lock-fontify-buffer-function)
-               'jit-lock-refontify)
-          ;; Don't fontify eagerly (and don't abort if the buffer is large).
-          (set (make-local-variable 'font-lock-fontified) t)
-          ;; Use jit-lock.
-          (jit-lock-register 'font-lock-fontify-region
-                             (not font-lock-keywords-only))
-           ;; Tell jit-lock how we extend the region to refontify.
-           (add-hook 'jit-lock-after-change-extend-region-functions
-                     'font-lock-extend-jit-lock-region-after-change
-                     nil t)))))
+  (case (font-lock-value-in-major-mode font-lock-support-mode)
+    (fast-lock-mode (fast-lock-mode t))
+    (lazy-lock-mode (lazy-lock-mode t))
+    (jit-lock-mode
+     ;; Prepare for jit-lock
+     (remove-hook 'after-change-functions
+                  'font-lock-after-change-function t)
+     (set (make-local-variable 'font-lock-fontify-buffer-function)
+          'jit-lock-refontify)
+     ;; Don't fontify eagerly (and don't abort if the buffer is large).
+     (set (make-local-variable 'font-lock-fontified) t)
+     ;; Use jit-lock.
+     (jit-lock-register 'font-lock-fontify-region
+                        (not font-lock-keywords-only))
+     ;; Tell jit-lock how we extend the region to refontify.
+     (add-hook 'jit-lock-after-change-extend-region-functions
+               'font-lock-extend-jit-lock-region-after-change
+               nil t))))
 
 (defun font-lock-turn-off-thing-lock ()
   (cond ((bound-and-true-p fast-lock-mode)