From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Koppelman Newsgroups: gmane.emacs.bugs Subject: bug#192: regexp does not work as documented Date: Mon, 12 May 2008 12:04:43 -0500 Message-ID: References: <87k5i8ukq8.fsf@stupidchicken.com> <200805061335.11379.bruno@clisp.org> <48204B3D.6000500@gmx.at> <4826A303.3030002@gmx.at> <87abiwoqzd.fsf@stupidchicken.com> Reply-To: David Koppelman , 192@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1210622357 16257 80.91.229.12 (12 May 2008 19:59:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 May 2008 19:59:17 +0000 (UTC) Cc: Chong Yidong , 192@emacsbugs.donarmstrong.com, Bruno Haible , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 12 21:59:52 2008 Return-path: Envelope-to: geb-bug-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 1JveBT-0008Uy-HH for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 May 2008 21:59:43 +0200 Original-Received: from localhost ([127.0.0.1]:54244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JveAk-0006MS-RD for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 May 2008 15:58:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JvbYt-0002Af-SL for bug-gnu-emacs@gnu.org; Mon, 12 May 2008 13:11:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JvbYs-0002AG-0j for bug-gnu-emacs@gnu.org; Mon, 12 May 2008 13:11:43 -0400 Original-Received: from [199.232.76.173] (port=56484 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JvbYr-0002AB-TO for bug-gnu-emacs@gnu.org; Mon, 12 May 2008 13:11:41 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:37739) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JvbYr-0007qO-D7 for bug-gnu-emacs@gnu.org; Mon, 12 May 2008 13:11:41 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m4CHBdFx025622; Mon, 12 May 2008 10:11:39 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m4CHA5U7025028; Mon, 12 May 2008 10:10:05 -0700 X-Loop: don@donarmstrong.com Resent-From: David Koppelman Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 12 May 2008 17:10:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 192 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 192-submit@emacsbugs.donarmstrong.com id=B192.121061188723537 (code B ref 192); Mon, 12 May 2008 17:10:05 +0000 Original-Received: (at 192) by emacsbugs.donarmstrong.com; 12 May 2008 17:04:47 +0000 Original-Received: from ecelsrv1.ece.lsu.edu (ecelsrv1.ece.lsu.edu [130.39.223.98]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m4CH4i7b023531 for <192@emacsbugs.donarmstrong.com>; Mon, 12 May 2008 10:04:45 -0700 Original-Received: from localhost (unknown [127.0.0.1]) by ecelsrv1.ece.lsu.edu (Postfix) with ESMTP id D0DDE283C5; Mon, 12 May 2008 17:04:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at ece.lsu.edu Original-Received: from ecelsrv1.ece.lsu.edu ([127.0.0.1]) by localhost (ecelsrv1.ece.lsu.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AMet342Tmzkl; Mon, 12 May 2008 12:04:43 -0500 (CDT) Original-Received: from nested.ece.lsu.edu (nested.ece.lsu.edu [130.39.222.143]) by ecelsrv1.ece.lsu.edu (Postfix) with ESMTP id 204C7283C0; Mon, 12 May 2008 12:04:43 -0500 (CDT) In-Reply-To: (Stefan Monnier's message of "Mon, 12 May 2008 12:29:01 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Mon, 12 May 2008 13:11:43 -0400 X-Mailman-Approved-At: Mon, 12 May 2008 15:58:21 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:17981 Archived-At: > a multiline region spanning 0..400. Before fontifying, you need > to unfontify. The region 100..200 can be completely unfontified, but Hadn't thought about that. I don't want things to get too elaborate but it would be nice to have guaranteed behavior below some multi-line size and not risk slow behavior. One possibility is to retain the code as it is, except have extend-region-multiline extend to some maximum size (say, 100 lines) with the expectation that the larger region would be used for deferred fontification (I guess jit-lock does that). The only difference with current operation is that the font-lock-multiline property is ignored both ensuring proper matches (when the property is not present but a pattern would match) and avoiding huge sized regions. Now, if we wanted really large multi-line matches we could unfontify the larger region but use a window+margin sized region (accounting for all buffers visiting the file) for the regular patterns and then mark the other parts of the larger region as unfontified. This would force re-applying the multi-line patterns on buffer motion, though we could cache the match data to avoid re-seaching. Stefan Monnier writes: >> I'm proposing that font-lock divide keywords into two or three >> classes, ordinary, multi-line, and maybe mega-line, matches for >> multi-line and mega-line keywords would be over much larger >> regions. Here is how it might work with two classes (keep in mind that >> I don't yet have a thorough understanding of font-lock and jit-lock): > > I do not understand how you propose to solve the main problem: > Let's say you want to fontify a line spanning chars 100..200 and > a multiline region spanning 0..400. Before fontifying, you need > to unfontify. The region 100..200 can be completely unfontified, but > what about 0..99 and 201..400? You can't unfontify them completely > since you don't want to refontify them completely either, so you'd need > to figure out which part of the fontification comes from the > multiline keywords. > > Also, the order between keywords is important, so unless you force all > multiline keywords to go at the very end, you'd also need to remove (on > the 0..99 and 201..400 regions) the fontification coming from small > keywords that were placed after multiline keywords and reapply > it afterwards? > > > Stefan