From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Tury Newsgroups: gmane.emacs.help Subject: Re: Adding color to macro in C mode Date: Tue, 31 Jan 2006 15:30:42 GMT Organization: Nokia Message-ID: <43z84xa021z3$.1pjyzd5hm0ez5.dlg@40tude.net> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1138727780 2048 80.91.229.2 (31 Jan 2006 17:16:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2006 17:16:20 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 31 18:16:13 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F3z6Q-0002Cv-Tm for geh-help-gnu-emacs@m.gmane.org; Tue, 31 Jan 2006 18:15:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F3z89-0001Rm-UV for geh-help-gnu-emacs@m.gmane.org; Tue, 31 Jan 2006 12:17:26 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fi.sn.net!newsfeed2.fi.sn.net!newsfeed3.funet.fi!newsfeed1.funet.fi!newsfeeds.funet.fi!nntp.inet.fi!inet.fi!newsfeed1.nokia.com!news1.nokia.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: 40tude_Dialog/2.0.15.1 Original-Lines: 38 Original-NNTP-Posting-Host: 172.24.170.172 Original-X-Complaints-To: newsmaster@nokia.com Original-X-Trace: news1.nokia.com 1138721442 172.24.170.172 (Tue, 31 Jan 2006 17:30:42 EET) Original-NNTP-Posting-Date: Tue, 31 Jan 2006 17:30:42 EET Original-Xref: shelby.stanford.edu gnu.emacs.help:137308 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:32931 Archived-At: On Tue, 31 Jan 2006 10:08:43 +0100, Joakim Hove wrote: > Hello, > > I am using emacs to program C. I have a (C) macro F_DIFF(a,b,c) which > I use quite a lot in my code. I would like emacs to color instances of > this macro so it stands out more clearly in the code - any tips on how > to achieve that? If you want to highlight it only temporarily you may want to try highlight-regexp: C-x w h runs the command highlight-regexp which is an alias for `hi-lock-face-buffer' in `hi-lock'. (highlight-regexp REGEXP &optional FACE) Set face of each match of REGEXP to FACE. Interactively, prompt for REGEXP then FACE. Buffer-local history list maintained for regexps, global history maintained for faces. Use M-n and M-p to retrieve next or previous history item. (See info node `Minibuffer History') or highlight-phrase: C-x w p runs the command highlight-phrase which is an alias for `hi-lock-face-phrase-buffer' in `hi-lock'. (highlight-phrase REGEXP &optional FACE) Set face of each match of phrase REGEXP to FACE. Whitespace in REGEXP converted to arbitrary whitespace and initial lower-case letters made case insensitive. These are in my Edit menu also. Br, P