diff lisp/font-lock.el @ 5294:f5fdaf66b013

(font-lock-set-defaults): Do nothing if font-lock-keywords is already set.
author Richard M. Stallman <rms@gnu.org>
date Thu, 23 Dec 1993 04:36:41 +0000
parents 64211dda414c
children 7e5fce72b793
line wrap: on
line diff
--- a/lisp/font-lock.el	Thu Dec 23 04:35:44 1993 +0000
+++ b/lisp/font-lock.el	Thu Dec 23 04:36:41 1993 +0000
@@ -409,16 +409,17 @@
 
 (defun font-lock-set-defaults ()
   "Set `font-lock-keywords' to something appropriate for this mode."
-  (setq font-lock-keywords
-	(cond ((eq major-mode 'lisp-mode)	lisp-font-lock-keywords)
-	      ((eq major-mode 'emacs-lisp-mode)	lisp-font-lock-keywords)
-	      ((eq major-mode 'c-mode)		c-font-lock-keywords)
-	      ((eq major-mode 'c++-c-mode)	c-font-lock-keywords)
-	      ((eq major-mode 'c++-mode)	c++-font-lock-keywords)
-	      ((eq major-mode 'perl-mode)	perl-font-lock-keywords)
-	      ((eq major-mode 'tex-mode)	tex-font-lock-keywords)
-	      ((eq major-mode 'texinfo-mode)	texi-font-lock-keywords)
-	      (t nil))))
+  (if (not font-lock-keywords)		; if not already set.
+      (setq font-lock-keywords
+	    (cond ((eq major-mode 'lisp-mode)	    lisp-font-lock-keywords)
+		  ((eq major-mode 'emacs-lisp-mode) lisp-font-lock-keywords)
+		  ((eq major-mode 'c-mode)	    c-font-lock-keywords)
+		  ((eq major-mode 'c++-c-mode)	    c-font-lock-keywords)
+		  ((eq major-mode 'c++-mode)	    c++-font-lock-keywords)
+		  ((eq major-mode 'perl-mode) 	    perl-font-lock-keywords)
+		  ((eq major-mode 'tex-mode)        tex-font-lock-keywords)
+		  ((eq major-mode 'texinfo-mode)    texi-font-lock-keywords)
+		  (t nil))))
 
 (defconst lisp-font-lock-keywords-1
  '(;;