all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Defining and using custom faces and keywords
@ 2012-03-19 12:38 suvayu ali
  0 siblings, 0 replies; only message in thread
From: suvayu ali @ 2012-03-19 12:38 UTC (permalink / raw)
  To: Emacs mailing list

Hi,

I wanted to add custom keywords and highlight them with my custom face
on all buffers. So I tried something like this.

;; font-lock customisations
(defface font-lock-global-todo-face
  '((t (:background "royalblue4" :foreground "thistle" :weight bold)))
  "Face for the TODO keyword globally."
  :group 'font-lock-faces)

(add-hook 'find-file-hook
	  (lambda ()
	    (font-lock-add-keywords
	     nil '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)))
	    (font-lock-add-keywords
	     nil '(("\\<\\(TODO\\):" 1 font-lock-global-todo-face prepend))))
	    (font-lock-add-keywords
	     nil '(("\\<\\(NB\\):" 1 font-lock-global-todo-face prepend))))

I was expecting FIXME: to be displayed with font-lock-warning-face in
all buffers and TODO: and NB: to be displayed with
font-lock-global-todo-face. However only FIXME: is displayed as
expected. When I check the value of font-lock-global-todo-face with
customize-face, I see the correct value with the sample text displayed
as I expect. What could be going wrong here? Am I missing any steps in
defining my custom face?

Thanks in advance.

-- 
Suvayu

Open source is the future. It sets us free.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-03-19 12:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-19 12:38 Defining and using custom faces and keywords suvayu ali

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.