From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Fab Newsgroups: gmane.emacs.help Subject: Re: Individual character coloring Date: Wed, 30 May 2012 18:43:37 +0200 Organization: albasani.net Message-ID: <87r4u1hb5y.fsf@gmail.com> References: <87sjei3p8n.fsf@gmail.com> <10c50e7c-79fd-495b-aeaf-560f3078df42@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1338396314 13117 80.91.229.3 (30 May 2012 16:45:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 30 May 2012 16:45:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 30 18:45:13 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SZm1J-0007ug-1K for geh-help-gnu-emacs@m.gmane.org; Wed, 30 May 2012 18:45:13 +0200 Original-Received: from localhost ([::1]:34649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZm1I-0004xO-Pk for geh-help-gnu-emacs@m.gmane.org; Wed, 30 May 2012 12:45:12 -0400 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!news2.euro.net!news.mixmin.net!news.albasani.net!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 Original-X-Trace: news.albasani.net 4C+RNWIDv/GP66e91BhSXlcAcJ5gdyY4h0io77zhFlEXYq/QGpHcvskRNdXoUkdbQ0rkzVDVeLnUZGP8hfwZvVx8L1VEU+gD4EURqvTyqu/QyPdF3O1rNckDQcE6DYZe Original-NNTP-Posting-Date: Wed, 30 May 2012 16:43:38 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="FdOqw7TkVMMgfZCZ9Muy3BUx+uh3rzAwOEL+9U69sDasp+pGvBsSUkzPjZjqyzcNxpQQw8kGbjUzQVwl8yznrQhqqAgSe+ubopRw9U6o8laA9NFfLzO74r+b9QObIvSj"; mail-complaints-to="abuse@albasani.net" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:BXzT70ry6hgzymLoLX02RJNt7Wk= sha1:ueKcvUfFjpCSWmC3fBaf5MlLWck= Original-Xref: usenet.stanford.edu gnu.emacs.help:192644 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85050 Archived-At: jpkotta writes: > On Wednesday, May 30, 2012 6:03:20 AM UTC-5, Fab wrote: >> Dear All, >> >> I would like to highlight the semicolon with a different color in >> c++-mode and also matlab-mode. I could not identify a special face of >> the semicolon with C-u C-x =, is there something like >> font-lock-comment-delimiter-face for a line terminator? If not is there >> an easy way to accomplish my need? >> >> Thanks >> Fab > > I do something similar to this for most programming modes: > > ,---- > | (defvar operators-regexp > | (regexp-opt '("+" "-" "*" "/" "%" "!" > | "&" "^" "~" "|" > | "=" "<" ">" > | "." "," ";" ":" "?")) > | "Regexp matching symbols that are operators in most programming > | languages.") > | > | (setq operators-font-lock-spec > | (cons operators-regexp > | (list > | 0 ;; use whole match > | 'font-lock-builtin-face > | 'keep ;; OVERRIDE > | ))) > | > | (font-lock-add-keywords > | 'c++-mode > | (list > | operators-font-lock-spec)) > `---- > > Clearly you can use whatever face you want instead of font-lock-builtin-face. cool! appreciated Fab