From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Lars Brange Newsgroups: gmane.emacs.help Subject: Re: C++ mode. Date: Tue, 27 May 2003 07:18:02 GMT Organization: AURUM Scandinavia AB Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3ED3119C.52ACC6B7@aurum.se> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============62194153190684587==" X-Trace: main.gmane.org 1054020029 12337 80.91.224.249 (27 May 2003 07:20:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 27 May 2003 07:20:29 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Tue May 27 09:20:19 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 19KYkp-0003CZ-00 for ; Tue, 27 May 2003 09:20:15 +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 19KYlP-0001g1-M2 for gnu-help-gnu-emacs@m.gmane.org; Tue, 27 May 2003 03:20:51 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news.algonet.se!algonet!news-stob.telia.net!telia.net!217.209.241.173.MISMATCH!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en Original-Newsgroups: gnu.emacs.help Original-Lines: 165 Original-NNTP-Posting-Host: 213.65.17.201 Original-X-Complaints-To: abuse@telia.com Original-X-Trace: newsb.telia.net 1054019882 213.65.17.201 (Tue, 27 May 2003 09:18:02 CEST) Original-NNTP-Posting-Date: Tue, 27 May 2003 09:18:02 CEST Original-Xref: shelby.stanford.edu gnu.emacs.help:113716 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:10210 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10210 --===============62194153190684587== content-type: multipart/alternative; boundary="------------70AC35FA0980E594C118D8EF" --------------70AC35FA0980E594C118D8EF Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Look at the font-lock function in the manual. See below for an example from my .emacs file. (defun lars-setup-color-faces () (custom-set-faces '(font-lock-comment-face ((t (:foreground "darkblue" :bold nil))) t) '(font-lock-string-face ((t (:foreground "darkgreen"))) t) '(font-lock-keyword-face ((t (:foreground "red" :bold nil))) t) '(font-lock-builtin-face ((t (:foreground "black" :bold nil))) t) '(font-lock-function-name-face ((t (:foreground "black" :bold t))) t) '(font-lock-variable-name-face ((t (:foreground "black"))) t) '(font-lock-type-face ((t (:foreground "red" :bold nil))) t) '(font-lock-constant-face ((t (:foreground "black" :bold t))) t) '(font-lock-warning-face ((t (:foreground "black" :bold t))) t) '(font-lock-reference-face ((t (:foreground "green" :bold t))) t) '(font-lock-doc-string-face ((t (:foreground "blue"))) t) '(highlight ((t (:foreground "cyan" :background "darkblue"))) t) '(zmacs-region ((t (:foreground "white" :background "darkblue"))) t) '(isearch ((t (:foreground "white" :background "darkblue"))) t) '(irchat-my-nick-highlight ((t (:foreground "yellow" :background "blue" :bold t))) t) '(dired-face-permissions ((t (:foreground "white" :background "blue"))) t) '(gnus-cite-face-1 ((t (:foreground "green"))) t) '(gnus-cite-face-2 ((t (:foreground "cyan"))) t) '(gnus-cite-face-3 ((t (:foreground "pink"))) t) '(gnus-cite-face-4 ((t (:foreground "red"))) t))) (lars-setup-color-faces) (setq font-lock-maximum-decoration t) (global-font-lock-mode t) Lars K Hollingworth wrote: > According to emacs I have > > GNU Emacs 20.7.1 (i386-redhat-linux-gnu, X toolkit) of Fri Mar 16 2001 on > porky.devel.redhat.com > > I would like to customise c++ mode so that lines starting std::cerr are > marked in a different red as most of them are for debugging and it > would be nice to be able to spot them easily. Is this possible? It > would be acceptable to mark everything in the std namespace in red. > > I'm a bit of a newbie with emacs so apologies as I don't know all the > terminology yet! > > -- > Kirsty Hollingworth > Department of Biology, University of York, York, YO10 5YW --------------70AC35FA0980E594C118D8EF Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Look at the font-lock function in the manual. See below for an example from my .emacs file.

(defun lars-setup-color-faces ()
  (custom-set-faces
   '(font-lock-comment-face             ((t (:foreground "darkblue" :bold nil))) t)
   '(font-lock-string-face              ((t (:foreground "darkgreen"))) t)
   '(font-lock-keyword-face             ((t (:foreground "red" :bold nil))) t)
   '(font-lock-builtin-face             ((t (:foreground "black" :bold nil))) t)
   '(font-lock-function-name-face       ((t (:foreground "black" :bold t))) t)
   '(font-lock-variable-name-face       ((t (:foreground "black"))) t)
   '(font-lock-type-face                ((t (:foreground "red" :bold nil))) t)
   '(font-lock-constant-face            ((t (:foreground "black" :bold t))) t)
   '(font-lock-warning-face             ((t (:foreground "black" :bold t))) t)
   '(font-lock-reference-face           ((t (:foreground "green" :bold t))) t)
   '(font-lock-doc-string-face          ((t (:foreground "blue"))) t)
 
   '(highlight                          ((t (:foreground "cyan" :background "darkblue"))) t)
   '(zmacs-region                       ((t (:foreground "white" :background "darkblue"))) t)
   '(isearch                            ((t (:foreground "white" :background "darkblue"))) t)
 
   '(irchat-my-nick-highlight           ((t (:foreground "yellow" :background "blue" :bold t))) t)
 
   '(dired-face-permissions             ((t (:foreground "white" :background "blue"))) t)
 
   '(gnus-cite-face-1                   ((t (:foreground "green"))) t)
   '(gnus-cite-face-2                   ((t (:foreground "cyan"))) t)
   '(gnus-cite-face-3                   ((t (:foreground "pink"))) t)
   '(gnus-cite-face-4                   ((t (:foreground "red"))) t)))
 

(lars-setup-color-faces)
(setq font-lock-maximum-decoration t)
(global-font-lock-mode t)
 

Lars

K Hollingworth wrote:

According to emacs I have

GNU Emacs 20.7.1 (i386-redhat-linux-gnu, X toolkit) of Fri Mar 16 2001 on
porky.devel.redhat.com

I would like to customise c++ mode so that lines starting std::cerr are
marked in a different red as most of them are for debugging and it
would be nice to be able to spot them easily.  Is this possible?  It
would be acceptable to mark everything in the std namespace in red.

I'm a bit of a newbie with emacs so apologies as I don't know all the
terminology yet!

--
 Kirsty Hollingworth                                <kh25@york.ac.uk>
      Department of Biology, University of York, York, YO10 5YW


 
  --------------70AC35FA0980E594C118D8EF-- --===============62194153190684587== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://mail.gnu.org/mailman/listinfo/help-gnu-emacs --===============62194153190684587==--