From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.help Subject: Re: set face for added font lock keywords Date: Mon, 10 Jan 2011 08:43:21 +0200 Message-ID: <871v4ls1h2.fsf@mithlond.arda> References: <865aa6b0-9ca4-4b98-8b41-ecc8c245e84d@r29g2000yqj.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1294642331 7468 80.91.229.12 (10 Jan 2011 06:52:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 10 Jan 2011 06:52:11 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: extronom@googlemail.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 10 07:52:07 2011 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.69) (envelope-from ) id 1PcBbd-0002qc-86 for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Jan 2011 07:52:07 +0100 Original-Received: from localhost ([127.0.0.1]:34756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PcBbb-0001dc-L7 for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Jan 2011 01:51:51 -0500 Original-Received: from [140.186.70.92] (port=53925 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PcBTp-0004ui-TQ for help-gnu-emacs@gnu.org; Mon, 10 Jan 2011 01:44:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PcBTX-0003Vr-Dz for help-gnu-emacs@gnu.org; Mon, 10 Jan 2011 01:43:49 -0500 Original-Received: from mta-out.inet.fi ([195.156.147.13]:52072 helo=jenni2.inet.fi) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PcBTX-0003R8-3u for help-gnu-emacs@gnu.org; Mon, 10 Jan 2011 01:43:31 -0500 Original-Received: from mithlond.arda (84.251.132.215) by jenni2.inet.fi (8.5.133) id 4D061FFC01082027; Mon, 10 Jan 2011 08:43:21 +0200 Original-Received: from dtw by mithlond.arda with local (Exim 4.69) (envelope-from ) id 1PcBTN-00015h-AN; Mon, 10 Jan 2011 08:43:21 +0200 In-Reply-To: <865aa6b0-9ca4-4b98-8b41-ecc8c245e84d@r29g2000yqj.googlegroups.com> (extronom@googlemail.com's message of "Sun, 9 Jan 2011 07:27:30 -0800 (PST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:78353 Archived-At: * 2011-01-09 07:27 (-0800), extronom@googlemail.com wrote: > I'm trying to add some new keywords by doing font-lock-add-keywords so > that a FIXME keyword gets highlighted, which works quite well. When I > try to change the color of the used face it doesn't work and probably > somebody could give me a hint what the problem is here (I'm still a > newbie regarding elisp programming). I'm the author of wcheck-mode [1], so perhaps quite naturally I would use it for this task too. Let's create a new language called "fixme" and choose some face for highlighting: ;; Make sure the variable exists. (defvar wcheck-language-data nil) (push '("fixme" (program . (lambda (strings) (when (member "FIXME" strings) (list "FIXME")))) (face . highlight)) wcheck-language-data) This configuration uses face "highlight" but you can use any face you want. Change languages with command wcheck-change-language and switch the mode on and off with command wcheck-mode. See the Emacs wiki page [1] for more information about wcheck-mode. --------------- 1. http://www.emacswiki.org/emacs/WcheckMode