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: Auto-discovery of multi-line font-lock regexps Date: Tue, 06 May 2008 21:08:33 -0400 Message-ID: References: <87k5i8ukq8.fsf@stupidchicken.com> <200805062335.59206.bruno@clisp.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1210122529 29868 80.91.229.12 (7 May 2008 01:08:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 May 2008 01:08:49 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 07 03:09:24 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JtY9r-0001yI-Sz for ged-emacs-devel@m.gmane.org; Wed, 07 May 2008 03:09:24 +0200 Original-Received: from localhost ([127.0.0.1]:36179 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JtY99-0004hR-Pq for ged-emacs-devel@m.gmane.org; Tue, 06 May 2008 21:08:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JtY96-0004hM-Gl for emacs-devel@gnu.org; Tue, 06 May 2008 21:08:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JtY95-0004hA-69 for emacs-devel@gnu.org; Tue, 06 May 2008 21:08:36 -0400 Original-Received: from [199.232.76.173] (port=33411 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JtY94-0004h7-W5 for emacs-devel@gnu.org; Tue, 06 May 2008 21:08:35 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JtY94-0002j9-IM for emacs-devel@gnu.org; Tue, 06 May 2008 21:08:34 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgoFAJudIEhMCqqd/2dsb2JhbACBU6tP X-IronPort-AV: E=Sophos;i="4.27,445,1204520400"; d="scan'208";a="20001811" Original-Received: from smtp.pppoe.ca (HELO smtp.teksavvy.com) ([65.39.196.238]) by ironport2-out.teksavvy.com with ESMTP; 06 May 2008 21:08:34 -0400 Original-Received: from pastel.home ([76.10.170.157]) by smtp.teksavvy.com (Internet Mail Server v1.0) with ESMTP id NGP23434; Tue, 06 May 2008 21:08:34 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id F41A87FFC; Tue, 6 May 2008 21:08:33 -0400 (EDT) In-Reply-To: <200805062335.59206.bruno@clisp.org> (Bruno Haible's message of "Tue, 6 May 2008 23:35:59 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:96623 Archived-At: While reading the "regexp does not work as documented" thread, an idea came to me: we could have an idle task that takes the font-lock regexps and instead of applying them directly, only uses them to find matches that span multiple lines and mark them with the `font-lock-multiline' property. The idea is that the font-lock-multiline works OK to preserve multiline matches, so the real difficulty is in making sure we discover them correctly. Sometimes we do by happenstance, sometimes we do because the major-mode was careful to make it work (which is far from trivial), but often we just don't. Having such a background loop would be very helpful. Its job can easily be stopped at any time, so it shouldn't introduce long latencies. Stefan