From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?iso-8859-1?q?Bockg=E5rd?=) Newsgroups: gmane.emacs.help Subject: Re: [Newbie] Colorizing keywords Date: Thu, 24 Apr 2003 19:06:06 +0200 Organization: Chalmers University of Technology, Sweden Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1051204412 16821 80.91.224.249 (24 Apr 2003 17:13:32 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 24 Apr 2003 17:13:32 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 24 19:13:30 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 198kEt-00045M-00 for ; Thu, 24 Apr 2003 19:10:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 198kEq-0006KX-03 for gnu-help-gnu-emacs@m.gmane.org; Thu, 24 Apr 2003 13:10:24 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.stueberl.de!news-FFM2.ecrc.net!uio.no!news.netg.se!dd.chalmers.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-NNTP-Posting-Host: helm.dd.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.090018 (Oort Gnus v0.18) Emacs/21.2 (usg-unix-v) Cancel-Lock: sha1:C5EpWJ+nYbiJqTNhln4yGojfNrY= Original-Xref: shelby.stanford.edu gnu.emacs.help:112282 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:8780 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:8780 Robert Pollard writes: > What about making my own definitions for colorization? Is it > possible to create my own database of keywords and define the color > that is used for each? [...] > Any ideas? Read the fine manual: ,----[ (info "(emacs)Font Lock") ] | Font Lock highlighting patterns already exist for many modes, but you | may want to fontify additional patterns. You can use the function | `font-lock-add-keywords', to add your own highlighting patterns for a | particular mode. For example, to highlight `FIXME:' words in C | comments, use this: | | (font-lock-add-keywords | 'c-mode | '(("\\<\\(FIXME\\):" 1 font-lock-warning-face t))) | | To remove keywords from the font-lock highlighting patterns, use the | function `font-lock-remove-keywords'. `---- -- Johan Bockgård