From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Last steps for pretesting (font-lock-extend-region-function) Date: Tue, 25 Apr 2006 15:23:56 -0400 Message-ID: References: <873bg2g1fw.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1145993075 20001 80.91.229.2 (25 Apr 2006 19:24:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 25 Apr 2006 19:24:35 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 25 21:24:31 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FYT90-0005PS-T2 for ged-emacs-devel@m.gmane.org; Tue, 25 Apr 2006 21:24:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYT8z-00032k-SA for ged-emacs-devel@m.gmane.org; Tue, 25 Apr 2006 15:24:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FYT8o-00032e-PU for emacs-devel@gnu.org; Tue, 25 Apr 2006 15:24:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FYT8m-00032S-NA for emacs-devel@gnu.org; Tue, 25 Apr 2006 15:24:05 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYT8m-00032P-Hr for emacs-devel@gnu.org; Tue, 25 Apr 2006 15:24:04 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FYTBI-0004go-Vz for emacs-devel@gnu.org; Tue, 25 Apr 2006 15:26:41 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id E0C4F2CF8CE; Tue, 25 Apr 2006 15:24:02 -0400 (EDT) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id A144B452A; Tue, 25 Apr 2006 15:23:56 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 8CEDB71500; Tue, 25 Apr 2006 15:23:56 -0400 (EDT) Original-To: Ralf Angeli In-Reply-To: (Ralf Angeli's message of "Tue, 25 Apr 2006 08:21:23 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:53406 Archived-At: >> I was talking about programmer work, and I've shown you the code for >> font-lock-multiline: it's quite a bit shorter and more straightforward >> than your hack using b-c-f and a-c-f: just match the multiline element, >> place a font-lock-multiline property on it, and you're set. > Do you even have to bother with placing font-lock-multiline properties > manually? In AUCTeX we simply set the font-lock-multiline variable to > t and font-lock added the property automatically. Of course, you can indeed just set the variable, but this has more impact on performance (e.g. every time it matches a keyword, font-lock will then check whether it spans several lines, even if the keyword pattern is something silly like "foo" which clearly can't span multiple lines), and will not always work correctly if the MATCHER was a function rather than a regexp. I suggested to do it manually because it is more explicit, it gives you more control, and most importantly I haven't seen the part of c-awk-font-lock-keywords which cares about multiple lines, so I haven't convinced myself that it would work for his example. Stefan