From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: dkcombs@panix.com (David Combs) Newsgroups: gmane.emacs.help Subject: Re: please help with font-lock-add-keywords Date: Thu, 7 Jan 2010 00:39:06 +0000 (UTC) Organization: Public Access Networks Corp. Message-ID: References: NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1262826141 15222 80.91.229.12 (7 Jan 2010 01:02:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Jan 2010 01:02:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 07 02:02:14 2010 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 1NSglR-0007zW-Qm for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Jan 2010 02:02:13 +0100 Original-Received: from localhost ([127.0.0.1]:37084 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSgRP-00076I-6b for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Jan 2010 19:41:31 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!novia!news-out.readnews.com!news-xxxfer.readnews.com!panix!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 62 Original-NNTP-Posting-Host: panix3.panix.com Original-X-Trace: reader1.panix.com 1262824746 2910 166.84.1.3 (7 Jan 2010 00:39:06 GMT) Original-X-Complaints-To: abuse@panix.com Original-NNTP-Posting-Date: Thu, 7 Jan 2010 00:39:06 +0000 (UTC) X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Original-Xref: news.stanford.edu gnu.emacs.help:176009 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:71098 Archived-At: In article , Tassilo Horn wrote: >bufie writes: > >Hi! > >> I'd like to fontify a whole bunch of function names for a project I'm >> working on (which uses lisp mode, not emacs-lisp-mode -- for >> reference, I'm using GNU emacs 23.1.1). > >This works for me and highlights any symbol starting with qbb- in the >keyword face. > >--8<---------------cut here---------------start------------->8--- >(font-lock-add-keywords > 'lisp-mode > '(("\\" . font-lock-keyword-face))) >--8<---------------cut here---------------end--------------->8--- > >> (font-lock-add-keywords >> 'lisp-mode >> '(("\\<\\(qbb-create-image\\|qbb-destroy-image\\)\\>" . >> font-lock-keyword-face))) > >Looks ok to me. > >> (font-lock-add-keywords >> 'lisp-mode >> '(("\\<\\qbb-create-image\\)" 2 font-lock-keyword-face t))) > ^ >I think a paren is missing there. And if there was one, you would like >to highlight the first group, so the 2 has to be replaced with 1. > >> (add-hook 'lisp-mode-hook >> (lambda () >> (font-lock-add-keywords >> nil >> '(("\\<\\(qbb-create-image\\|qbb-destroy-image\\)\\>" . >> font-lock-keyword-face))))) > >Looks correct. But when using the ("regexp" . face) form, you can use >shy groups for performance reasons, because here you refer to the whole Please, what is a "shy group"? Some math thing? Thanks, David >match anyway and not to a group by number. > >Hm, if your first and last solutions don't work, I'd guess you are not >in lisp-mode... > >Bye, >Tassilo > > >