From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: How to make font lock work with comments? Date: Sun, 02 Jan 2011 23:28:25 -0500 Organization: A noiseless patient Spider Message-ID: References: <8649bced-1240-483b-ba41-9bc581938275@t8g2000prh.googlegroups.com> <87bp43nyha.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1294029687 19928 80.91.229.12 (3 Jan 2011 04:41:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 3 Jan 2011 04:41:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 03 05:41:23 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 1PZcER-00080R-BS for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Jan 2011 05:41:19 +0100 Original-Received: from localhost ([127.0.0.1]:54445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZcEQ-0005U3-Jq for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Jan 2011 23:41:18 -0500 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!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 12 Injection-Info: mx02.eternal-september.org; posting-host="7TKp2luQmWSGnmAmeWd+Kg"; logging-data="31792"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ZcRCs0IyZc0n6umoNW3jv" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:7MtooPpfmvNyOpQlid307jqME+E= sha1:LGqpUs/rafmJ92JFRx4OT+KJ7Rw= Original-Xref: usenet.stanford.edu gnu.emacs.help:183879 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:78087 Archived-At: > Font locking is a tricky matter. > (font-lock-add-keywords nil > '(("⍝.*" 0 font-lock-comment-face prepend) > ("[^\\]\"\\([^\"\\]*\\|\\.\\)\"" 0 font-lock-string-face prepend))) Bad idea: font-lock normally uses syntax-tables for comments and strings, so unless you *really* can't make it work with syntax-table, you shouldn't do it via font-lock-keywords. Stefan