help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I setup an extremely simple font-lock mode?


From: Barman Brakjoller
Subject: Re: How do I setup an extremely simple font-lock mode?
Date: 23 May 2003 06:50:30 -0700

> I want to setup a very simple mode for colorizing a log file.  All I 
> need to do is highlight any lines with the string ERROR on them.  I've 
> tried reading the documentation for font-lock but it's not clear how to 
> do this.

Maybe this is not exacly what you asked for,  but to me it seems as if
it will solve your problem. From the NEWS file, section Emacs 21.1
changes:

  *** The new package hi-lock.el provides commands to highlight
matches
  of interactively entered regexps.  For example,

   M-x highlight-regexp RET clearly RET RET

  will highlight all occurrences of `clearly' using a yellow
background
  face.  New occurrences of `clearly' will be highlighted as they are
  typed.  `M-x unhighlight-regexp RET' will remove the highlighting.
  Any existing face can be used for highlighting and a set of
  appropriate faces is provided.  The regexps can be written into the
  current buffer in a form that will be recognized the next time the
  corresponding file is read.  There are commands to highlight matches
  to phrases and to highlight entire lines containing a match.

Hope it works for you!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]