tags:

views:

135

answers:

2

Is there a way to get a word to be rendered with a different face in text mode?

+1  A: 

Yes,

What you want is font-lock-mode.

See here: http://www.gnu.org/software/emacs/manual/html%5Fnode/emacs/Font-Lock.html

Specifically you'll want to turn on font-lock-mode and then specify a list of keywords via font-lock-add-keywords.

chollida
huh ? in text mode ?
Bahbar
Sure why not, you just need to add a hook for text-mode. I've just done it on my local machine. What don't you think is possible?
chollida
+5  A: 

Check out `highlight-regexp'. Just type in the word you want to change the face for (although it can be any regular expression).

M-x highlight-regexp

highlight-regexp is an alias for `hi-lock-face-buffer' in
`hi-lock.el'.

It is bound to M-s h r.

(highlight-regexp regexp &optional face)

Set face of each match of regexp to face.

Interactively, prompt for regexp then face.  Buffer-local history
list maintained for regexps, global history maintained for faces.
Use M-p to retrieve previous history items,
and M-n to retrieve default values.
justinhj