From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oliver Scholz Newsgroups: gmane.emacs.devel Subject: Re: [paul@wolfbone.ath.cx: Re: re-builder bug(s)] Date: Fri, 09 Mar 2007 17:55:02 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1173459471 31255 80.91.229.12 (9 Mar 2007 16:57:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 9 Mar 2007 16:57:51 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 09 17:57:47 2007 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 1HPiOT-0000Wb-3U for ged-emacs-devel@m.gmane.org; Fri, 09 Mar 2007 17:56:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPiOm-00087g-2P for ged-emacs-devel@m.gmane.org; Fri, 09 Mar 2007 11:56:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HPiOa-00087b-Qp for emacs-devel@gnu.org; Fri, 09 Mar 2007 11:56:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HPiOY-00087P-Iz for emacs-devel@gnu.org; Fri, 09 Mar 2007 11:56:43 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPiOY-00087M-G6 for emacs-devel@gnu.org; Fri, 09 Mar 2007 11:56:42 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HPiOD-0008HO-7T for emacs-devel@gnu.org; Fri, 09 Mar 2007 11:56:21 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HPiNa-0005gl-H6 for emacs-devel@gnu.org; Fri, 09 Mar 2007 17:55:42 +0100 Original-Received: from dslb-084-058-046-124.pools.arcor-ip.net ([84.58.46.124]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Mar 2007 17:55:42 +0100 Original-Received: from alkibiades by dslb-084-058-046-124.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Mar 2007 17:55:42 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 56 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: dslb-084-058-046-124.pools.arcor-ip.net User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:67632 Archived-At: Richard Stallman writes: [...] > I don't know whether Detlev Zundel is still available, > so I cc'd this to emacs-devel. If Detlev doesn't fix this, > I hope that someone else will do so. I gave it a shot. [...] >> I also find (and I'm not quite sure whether it's a real bug or just >> something I haven't understood about regexps or re-builder) that >> expressions such as "\\>" and "$" in the re-builder buffer don't work >> (and are flagged as "*invalid*" in the modeline) but ".\\>" and ".$", >> >> Would you please send a precise, complete test case for this? > > Open a new buffer, put it in text mode and insert a line of text into it: > > C-x b *reb-test* RET M-x text-mode RET > Kidman's publicist, Catherine Olim, said the star was trying to shake zombies off the bonnet of her Jaguar when the car spun off the road. RET > > Try to use re-builder to count the number of words in the buffer: > > M-x re-builder RET > \\> > > As soon as the first `\' is entered between the `"'s, in the > *RE-Builder* buffer, "*invalid*" appears in the modeline. > Now replace the regexp in the *RE-Builder* buffer with another: > > DEL DEL DEL > .\\> > > Success! - the last character of each word in the *reb-test* buffer > has been highlighted and a message, "25 matches" has appeared in the > minibuffer. Likewise, the regexp, "^" will not find the empty string > at the beginning of the buffer but "^." will and "$" will not find the > end of the buffer but ".$" will. This happens in line 646 and following of re-builder.el. `reb-update-overlays' `re-search'es the buffer and checks whether the match is empty, otherwise it updates the match-overlays: (if (= 0 (length (match-string 0))) (error "Empty regular expression!")) So, this "bug" seems to be intentional. I wouldn't know what to do, anyways. How do you highlight an empty string? Oliver -- 19 Ventôse an 215 de la Révolution Liberté, Egalité, Fraternité!