[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: different font-lock faces for different modes
From: |
Joe Corneli |
Subject: |
Re: different font-lock faces for different modes |
Date: |
Sat, 16 Jul 2005 22:52:03 -0500 |
Sketch:
Make a variable that hold the alternate definition of the face you
want to use. Add to your `lisp-mode-hook' a function to set the
buffer-local value of `font-lock-comment-face' to the value of that
variable.
Details:
(setq ugly-face '((t ( :foreground "blue"))))
(add-hook 'lisp-mode-hook
(lambda () (make-local-variable font-lock-comment-face)
(setq font-lock-comment-face ugly-face)))
;; Yep, it works.
If for some ungodly reason you desire to switch between lisp mode and
C mode in the same buffer, you will have to continue slightly further
in the same vein.