unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* what's simple syntax for defining faces? (just color text and  background color)
@ 2009-09-02 19:25 Xah Lee
  2009-09-03  4:05 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: Xah Lee @ 2009-09-02 19:25 UTC (permalink / raw)
  To: help-gnu-emacs

i would like to highlight some phrases when a file is opened.

So, i thought i put this in the first line:

-*- eval-expression: (hi-lock-face-phrase-buffer "me:" 'red ) -*-

however, the proper syntax for hi-lock-face-phrase-buffer seems to be:

(hi-lock-face-phrase-buffer "me:"
(defface hi-pink
  '((((background dark)) (:background "red" :foreground "black"))
    (t (:background "red")))
  "Face for hi-lock mode."
  :group 'hi-lock-faces)
)

can it be simpler? I just need to color the text and background.

i have other people's names i need to color red, blue.

Thanks.

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: what's simple syntax for defining faces? (just color text and background color)
  2009-09-02 19:25 what's simple syntax for defining faces? (just color text and background color) Xah Lee
@ 2009-09-03  4:05 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2009-09-03  4:05 UTC (permalink / raw)
  To: help-gnu-emacs

Xah Lee wrote:
> i would like to highlight some phrases when a file is opened.
> 
> So, i thought i put this in the first line:
> 
> -*- eval-expression: (hi-lock-face-phrase-buffer "me:" 'red ) -*-
> 
> however, the proper syntax for hi-lock-face-phrase-buffer seems to be:
> 
> (hi-lock-face-phrase-buffer "me:"
> (defface hi-pink
>   '((((background dark)) (:background "red" :foreground "black"))
>     (t (:background "red")))
>   "Face for hi-lock mode."
>   :group 'hi-lock-faces)
> )
> 
> can it be simpler? I just need to color the text and background.
> 
> i have other people's names i need to color red, blue.

1. Write a function that takes a color name and defines/returns a face by that
    name with the appropriate attributes.

2. Make sure the file where that function is defined gets loaded.

3. Call the function to provide the FACE argument to hi-lock-face-phrase-buffer.

-- 
Kevin Rodgers
Denver, Colorado, USA





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-03  4:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-02 19:25 what's simple syntax for defining faces? (just color text and background color) Xah Lee
2009-09-03  4:05 ` Kevin Rodgers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).