From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ilya Zakharevich Newsgroups: gmane.emacs.help Subject: Re: will we ever have zero width assertions in regexps? Date: Wed, 2 Feb 2011 15:09:21 +0000 (UTC) Organization: U.C. Berkeley Math. Department. Message-ID: References: NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1296673141 30009 80.91.229.12 (2 Feb 2011 18:59:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 2 Feb 2011 18:59:01 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 02 19:58:57 2011 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.69) (envelope-from ) id 1Pkhuo-0005hC-8z for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Feb 2011 19:58:54 +0100 Original-Received: from localhost ([127.0.0.1]:39275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pkhun-0002nA-D4 for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Feb 2011 13:58:53 -0500 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 22 Injection-Date: Wed, 2 Feb 2011 15:09:21 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="LlLjF8LevGdIZWbTvv+SXA"; logging-data="30292"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sFqRPM9hmAdx1BBFz5++J" User-Agent: slrn/0.9.8.1pl1 (Linux) Cancel-Lock: sha1:YLyC1PQ9wWxn+fVzbB8RE4B0Ec8= Original-Xref: usenet.stanford.edu gnu.emacs.help:184780 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:78941 Archived-At: On 2011-01-31, Stefan Monnier wrote: >> So you have a REx which is matched against a line, but you want (in >> addition to the usual effects of matching) to know whether it "wanted" >> the match to overflow into the following line? > >> If so, it looks like "reusing the continuation state" would not be a >> serious optimization - it would add just a small multiplicative >> constant to the "use only the hypothetical bit" scenario... > > We could probably make it work with just that extra bit, indeed. > But with the full intermediate state, we get to just "start the search > with last line's state" instead of having to "start the search from the > previous N lines since they all ended with the bit set", so > it will happily work with many-lines cases without having to reparse > those many lines N times. Hmm, I thought about a different scenario: if the bit is set, then one switches to a DIFFERENT REx designed for a multi-line case. Otherwise why not just run it against the rest of the buffer, instead of one-line? Ilya