From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: brakjoller@hotmail.com (Barman Brakjoller) Newsgroups: gmane.emacs.help Subject: Re: How do I setup an extremely simple font-lock mode? Date: 23 May 2003 06:50:30 -0700 Organization: http://groups.google.com/ Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <1c58a7c3.0305230550.3352edcb@posting.google.com> References: NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1053698210 11690 80.91.224.249 (23 May 2003 13:56:50 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 23 May 2003 13:56:50 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Fri May 23 15:56:48 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19JD0E-0002rX-00 for ; Fri, 23 May 2003 15:54:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19JD1W-0008JF-9i for gnu-help-gnu-emacs@m.gmane.org; Fri, 23 May 2003 09:55:54 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 26 Original-NNTP-Posting-Host: 193.41.170.225 Original-X-Trace: posting.google.com 1053697831 18656 127.0.0.1 (23 May 2003 13:50:31 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: 23 May 2003 13:50:31 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:113618 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10113 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10113 > 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!