# HG changeset patch # User Stefan Monnier # Date 1270325414 14400 # Node ID cdab6ddd22d08e9c14256d9906f8916ef2470fa4 # Parent d0d89fd7a3516a26b6c8814e40347126d2a05518 * font-lock.el: Require CL when compiling. (font-lock-turn-on-thing-lock): Use `case'. diff -r d0d89fd7a351 -r cdab6ddd22d0 lisp/ChangeLog --- a/lisp/ChangeLog Sat Apr 03 16:59:53 2010 +0300 +++ b/lisp/ChangeLog Sat Apr 03 16:10:14 2010 -0400 @@ -1,3 +1,8 @@ +2010-04-03 Stefan Monnier + + * font-lock.el: Require CL when compiling. + (font-lock-turn-on-thing-lock): Use `case'. + 2010-04-03 Eli Zaretskii * emacs-lisp/authors.el (authors-fixed-entries): Add entry for Eli @@ -23,11 +28,11 @@ * 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 @@ -36,8 +41,7 @@ 2010-03-31 Chong Yidong - * cus-edit.el (custom-buffer-sort-alphabetically): Update - :version. + * cus-edit.el (custom-buffer-sort-alphabetically): Update :version. 2010-03-31 Juri Linkov diff -r d0d89fd7a351 -r cdab6ddd22d0 lisp/font-lock.el --- a/lisp/font-lock.el Sat Apr 03 16:59:53 2010 +0300 +++ b/lisp/font-lock.el Sat Apr 03 16:10:14 2010 -0400 @@ -209,6 +209,7 @@ ;;; Code: (require 'syntax) +(eval-when-compile (require 'cl)) ;; Define core `font-lock' group. (defgroup font-lock '((jit-lock custom-group)) @@ -902,26 +903,24 @@ (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)