unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* custom function to highlight keywords
@ 2003-03-20  5:40 trex_eater
  2003-03-20  9:24 ` foomaster1200
  0 siblings, 1 reply; 4+ messages in thread
From: trex_eater @ 2003-03-20  5:40 UTC (permalink / raw)


Time to time I have to look at huge log files for certain key words.
So, I wrote a small lisp function to highlight the keywords. I figured
some of the syntax from looking at few lisp codes.

The function high-on1 works fine. The function high-on2 does not work.
Can some one point out what I am doing wrong. Thanks.


(defun high-on1 ()
	(setq my-keywords '(("\\(setq\\|font-lock\\|keywords\\)" 
        (0 my-new-face))))
	(setq font-lock-keywords (append font-lock-keywords my-keywords))
)

(defun high-on2 ( expname)
	(interactive "Bexpname: ")
	(setq my-temp (concat "\\(" expname "\\)" ))
        ;; Not sure about the line below...
	(setq my-keywords (my-temp (0 my-new-face)))  
	(setq font-lock-keywords (append font-lock-keywords my-keywords))
)

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

end of thread, other threads:[~2003-03-21 16:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-20  5:40 custom function to highlight keywords trex_eater
2003-03-20  9:24 ` foomaster1200
2003-03-20 15:01   ` trex_eater
2003-03-21 16:26     ` 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).