[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
custom function to highlight keywords
From: |
trex_eater |
Subject: |
custom function to highlight keywords |
Date: |
19 Mar 2003 21:40:00 -0800 |
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))
)
- custom function to highlight keywords,
trex_eater <=