# HG changeset patch # User Simon Marshall # Date 801997709 0 # Node ID e6001f10daad7b4ad4f373bd346fcd1afb9695b0 # Parent d23f2c9990b2bc6641bbea82c40a82f356b6e012 Made font-lock-compile-keywords not compile if it looks like it already has. diff -r d23f2c9990b2 -r e6001f10daad lisp/font-lock.el --- a/lisp/font-lock.el Wed May 31 21:18:55 1995 +0000 +++ b/lisp/font-lock.el Thu Jun 01 09:08:29 1995 +0000 @@ -497,25 +497,27 @@ ;;; Fontifying arbitrary patterns -(defun font-lock-compile-keywords () +(defun font-lock-compile-keywords (&optional keywords) ;; Compile `font-lock-keywords' into the form (t KEYWORD ...) where KEYWORD ;; is the (MATCHER HIGHLIGHT ...) shown in the variable's doc string. - (setq font-lock-keywords - (cons t - (mapcar (function - (lambda (item) - (cond ((nlistp item) - (list item '(0 font-lock-keyword-face))) - ((numberp (cdr item)) - (list (car item) (list (cdr item) - 'font-lock-keyword-face))) - ((symbolp (cdr item)) - (list (car item) (list 0 (cdr item)))) - ((nlistp (nth 1 item)) - (list (car item) (cdr item))) - (t - item)))) - font-lock-keywords)))) + (let ((keywords (or keywords font-lock-keywords))) + (setq font-lock-keywords + (if (eq (car-safe keywords) t) + keywords + (cons t + (mapcar + (function (lambda (item) + (cond ((nlistp item) + (list item '(0 font-lock-keyword-face))) + ((numberp (cdr item)) + (list (car item) (list (cdr item) 'font-lock-keyword-face))) + ((symbolp (cdr item)) + (list (car item) (list 0 (cdr item)))) + ((nlistp (nth 1 item)) + (list (car item) (cdr item))) + (t + item)))) + keywords)))))) (defsubst font-lock-apply-highlight (highlight) "Apply HIGHLIGHT following a match. See `font-lock-keywords'."