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: Multi-line font-lock parser Date: Mon, 10 Aug 2009 22:19:14 +0300 Organization: A noiseless patient Spider Message-ID: <87tz0fwk7h.fsf@iki.fi> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1249933251 4274 80.91.229.12 (10 Aug 2009 19:40:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Aug 2009 19:40:51 +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 Aug 10 21:40:45 2009 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 1Maajc-0000G7-Lu for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Aug 2009 21:40:44 +0200 Original-Received: from localhost ([127.0.0.1]:35908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Maajb-0004ww-HC for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Aug 2009 15:40:43 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-2.dfn.de!news.dfn.de!newsfeed.straub-nv.de!feeder.eternal-september.org!eternal-september.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 10 Original-X-Trace: news.eternal-september.org U2FsdGVkX1+RXV2VT7AGnwPHuuea18fbuoXDw3JSRiLr1aYg7HaDG1R0fXYVUpaJ5fZAy/5btPBTU/UM7g8CxaDwu2ctngOultU1UyUQN/18x8PHe/r9UjmLpyGceXd0o5jjS14r5Mx73zFbizWmzPjHggEAWh/S Original-X-Complaints-To: abuse@eternal-september.org Original-NNTP-Posting-Date: Mon, 10 Aug 2009 19:27:26 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-Auth-Sender: U2FsdGVkX18H7Y7dynLlUMl+ugClb3HUgVJ3QEo4gjkTM+LM6BjcaA== Cancel-Lock: sha1:4jj4N8bbFKJB+kmkVJJtpDhtzmQ= sha1:G49g6a6EbFkbQDi+zwZPgxNc6bg= Original-Xref: news.stanford.edu gnu.emacs.help:171861 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:67034 Archived-At: I'd like to write font-lock code which highlights the first line that (1) is non-empty and (2) does not start with a "#" comment character. This requires some multi-line parsing so plain regular expressions won't suffice. I'm too stupid to understand how to implement this kind of parsing. I can write a code which finds such a line but I don't know how to integrate it to font-lock. I don't understand the (info "(elisp) Font Lock Multiline") manual either. So I'd _really_ appreciate if someone posted an example code here.