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: Multi-line font-lock parser Date: Tue, 11 Aug 2009 09:18:14 +0300 Organization: A noiseless patient Spider Message-ID: <87tz0e50wp.fsf@iki.fi> References: <87tz0fwk7h.fsf@iki.fi> <87ocqn55z9.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 1249972854 30393 80.91.229.12 (11 Aug 2009 06:40:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Aug 2009 06:40:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 11 08:40:48 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 1Mal2M-0002XS-Vr for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Aug 2009 08:40:47 +0200 Original-Received: from localhost ([127.0.0.1]:43899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mal2L-0002t0-NS for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Aug 2009 02:40:45 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!nx01.iad01.newshosting.com!newshosting.com!216.196.98.140.MISMATCH!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.straub-nv.de!feeder.eternal-september.org!eternal-september.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-X-Trace: news.eternal-september.org U2FsdGVkX18i3NJGAJ8+gOAx1QaPRUsq1r7wJWN5hCxfP/7Km3HJ/Bm0NRI216p98a9cj1sri01V4tUcF1qUJot7/Q8atig1B4+JEThPzilVzM95E9djZ5PKOIvB95ecophLwAGs7P3w69qhF9+xSSd0xrqWmD3h Original-X-Complaints-To: abuse@eternal-september.org Original-NNTP-Posting-Date: Tue, 11 Aug 2009 06:26:28 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1+Z9yYPbe5huJjYHCduOooNchPY9JKEMEreqMoDHnuEBg== Cancel-Lock: sha1:SOSPhJq5jPQL434yQJvozShfdD8= sha1:/lbn0t8Z0dgI/BfJqlixMxmfO1Q= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:171868 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:67042 Archived-At: On 2009-08-11 07:48 (+0200), Thierry Volpiatto wrote: > Why do you want to integrate something to fontlock? To have it automatically updated when the buffer changes. I guess that's what the font-lock is for. No? > ,---- > | X ==> point > | > | # One line starting with #. > | > | the line we want to add text properties to. > `---- > > If you start to X (point) just running M-x test-prop will highlight > the line you want. > > Is it what you want to do? It's not all. The intend is to highlight buffer's first line which is not empty nor start with # character. Editing the buffer should update this automatically. So about your example, let's say that I later remove the leading comment character "# " from the third line. Now that changed line should automatically highlighted and the same highlighting removed from other lines. I assume such things can be done with font-locks?