* Running highlight-regexp in elisp function - not working
@ 2014-04-03 12:17 Angus Comber
2014-04-04 4:46 ` Alex Kost
0 siblings, 1 reply; 2+ messages in thread
From: Angus Comber @ 2014-04-03 12:17 UTC (permalink / raw)
To: Emacs Help
Hi
I want to run this elisp code to highlight various sections of text in a
particular type of log file.
I tried:
(defun abc-log ()
"abc log file highlighting"
(interactive)
(goto-char (point-min))
(highlight-regexp "message Event.*" hi-yellow)
)
But when I run I get error:
Symbol's value as variable is void: hi-yellow
And it doesn't highlight.
I just want to be able to highlight-regexp on specific text and use
hi-yellow. What am I doing wrong?
Angus
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Running highlight-regexp in elisp function - not working
2014-04-03 12:17 Running highlight-regexp in elisp function - not working Angus Comber
@ 2014-04-04 4:46 ` Alex Kost
0 siblings, 0 replies; 2+ messages in thread
From: Alex Kost @ 2014-04-04 4:46 UTC (permalink / raw)
To: Angus Comber; +Cc: Emacs Help
Angus Comber (2014-04-03 16:17 +0400) wrote:
> Hi
>
> I want to run this elisp code to highlight various sections of text in a
> particular type of log file.
>
> I tried:
>
> (defun abc-log ()
> "abc log file highlighting"
> (interactive)
> (goto-char (point-min))
> (highlight-regexp "message Event.*" hi-yellow)
> )
>
> But when I run I get error:
>
> Symbol's value as variable is void: hi-yellow
>
> And it doesn't highlight.
>
> I just want to be able to highlight-regexp on specific text and use
> hi-yellow. What am I doing wrong?
>
The error says it all: you use `hi-yellow' as a variable, it should be:
(highlight-regexp "message Event.*" 'hi-yellow)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-04 4:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-03 12:17 Running highlight-regexp in elisp function - not working Angus Comber
2014-04-04 4:46 ` Alex Kost
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).