From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#192: regexp does not work as documented Date: Sun, 11 May 2008 10:27:50 -0400 Message-ID: <87abiwoqzd.fsf__19002.8930003338$1210517599$gmane$org@stupidchicken.com> References: <87k5i8ukq8.fsf@stupidchicken.com> <200805061335.11379.bruno@clisp.org> <48204B3D.6000500@gmx.at> <4826A303.3030002@gmx.at> Reply-To: Chong Yidong , 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 1210517555 13041 80.91.229.12 (11 May 2008 14:52:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 May 2008 14:52:35 +0000 (UTC) Cc: David Koppelman , 192@emacsbugs.donarmstrong.com, Bruno Haible , emacs-devel@gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 11 16:53:12 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 1JvCvG-00055h-Lr for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 May 2008 16:53:10 +0200 Original-Received: from localhost ([127.0.0.1]:53201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JvCuY-0005cG-4S for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 May 2008 10:52:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JvCts-0005Vu-Kh for bug-gnu-emacs@gnu.org; Sun, 11 May 2008 10:51:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JvCtq-0005VA-Tz for bug-gnu-emacs@gnu.org; Sun, 11 May 2008 10:51:44 -0400 Original-Received: from [199.232.76.173] (port=42632 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JvCtq-0005V3-M9 for bug-gnu-emacs@gnu.org; Sun, 11 May 2008 10:51:42 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:41057) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JvCtq-0006gf-HB for bug-gnu-emacs@gnu.org; Sun, 11 May 2008 10:51:42 -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 m4BEpdYY022083; Sun, 11 May 2008 07:51:39 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m4BEZ3Mo019607; Sun, 11 May 2008 07:35:03 -0700 X-Loop: don@donarmstrong.com Resent-From: Chong Yidong Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 11 May 2008 14:35:03 +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.121051607918945 (code B ref 192); Sun, 11 May 2008 14:35:03 +0000 Original-Received: (at 192) by emacsbugs.donarmstrong.com; 11 May 2008 14:27:59 +0000 Original-Received: from furry (c-98-216-111-182.hsd1.ma.comcast.net [98.216.111.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m4BERuAW018939 for <192@emacsbugs.donarmstrong.com>; Sun, 11 May 2008 07:27:57 -0700 Original-Received: by furry (Postfix, from userid 1000) id AF917C049; Sun, 11 May 2008 10:27:50 -0400 (EDT) In-Reply-To: <4826A303.3030002@gmx.at> (martin rudalics's message of "Sun, 11 May 2008 09:40:51 +0200") 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: Sun, 11 May 2008 10:51:44 -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:17957 Archived-At: martin rudalics writes: >> First I'll work on the hi-lock warning as I described below, then I'll >> see about detecting and doing something helpful for additional >> situations where multi-line won't work. > > Think of the following pathological case: Devise a regexp to highlight > the first line of a buffer provided the buffer does not end with a > newline. Doing this with `font-lock-multiline' hardly makes any sense. Ideally, highlight-regexp should work automagically, instead of forcing users to do something extra to make their multi-line regexp work properly. The right way to do this is probably for hi-lock-mode to process the buffer initially, setting up text properties to make font-lock DTRT even for multi-line expressions. But that's a big job. As for making hi-lock-mode detect whether or not a regexp is multi-line, isn't that a computationally non-trivial problem? Maybe making hi-lock-mode turn on font-lock-multiline, while not foolproof, works often enough to be satisfactory.