From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?B?Tm9yZGz2dw==?= Newsgroups: gmane.emacs.help Subject: Syntax highlighting of operators in C and C++ mode Date: 17 Apr 2007 07:23:06 -0700 Organization: http://groups.google.com Message-ID: <1176819786.890850.258980@n76g2000hsh.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1176820549 1973 80.91.229.12 (17 Apr 2007 14:35:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 17 Apr 2007 14:35:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 17 16:35:43 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HdomV-0006XU-IA for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Apr 2007 16:35:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HdorE-0006m1-HY for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Apr 2007 10:40:36 -0400 Original-Path: shelby.stanford.edu!newshub.stanford.edu!postnews.google.com!n76g2000hsh.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-NNTP-Posting-Host: 150.227.15.253 Original-X-Trace: posting.google.com 1176819787 2037 127.0.0.1 (17 Apr 2007 14:23:07 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 17 Apr 2007 14:23:07 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; sv-SE; rv:1.8.1.3) Gecko/20060601 Firefox/2.0.0.3 (Ubuntu-edgy),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 netcache (NetCache NetApp/6.1.1RC1) Complaints-To: groups-abuse@google.com Injection-Info: n76g2000hsh.googlegroups.com; posting-host=150.227.15.253; posting-account=T25tbw0AAADoaalO12jRFAyM2dkqq2mX Original-Xref: shelby.stanford.edu gnu.emacs.help:147150 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:42754 Archived-At: Hey there, Emacs users! I am trying to get highlighting of operators to work on Emacs-CVS. Instead the following code ruins most of default font-locking in c- mode. (defface font-lock-operator-face '((((class color)) (:inherit font-lock-builtin-face :bold t))) "Font Lock mode face used to highlight operators..") ;; Adds fontification for operator +=3D for C mode and modes derived from C mode (defun pnw-c-mode-extra-font-locking () (font-lock-add-keywords nil (list (cons (concat "\\(" (regexp-opt (list "+=3D")) "\\)") '(1 font-lock-operator-face prepend)) ))) (add-hook 'c-mode-hook 'pnw-c-mode-extra-font-locking) What have done wrong? Many thanks in advance, Per Nordl=F6w