From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vincent Lefevre Newsgroups: gmane.emacs.bugs Subject: flush-lines and regexp problems with emacs 22.0.x Date: Tue, 16 Jan 2007 05:03:27 +0100 Message-ID: <20070116040327.GP10583@prunille.vinc17.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1168925560 7574 80.91.229.12 (16 Jan 2007 05:32:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 16 Jan 2007 05:32:40 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 16 06:32:38 2007 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 1H6guH-0005AH-GX for geb-bug-gnu-emacs@m.gmane.org; Tue, 16 Jan 2007 06:30:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H6guH-00034z-D4 for geb-bug-gnu-emacs@m.gmane.org; Tue, 16 Jan 2007 00:30:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H6fXn-0004og-H6 for bug-gnu-emacs@gnu.org; Mon, 15 Jan 2007 23:03:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H6fXm-0004oP-G7 for bug-gnu-emacs@gnu.org; Mon, 15 Jan 2007 23:03:31 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H6fXm-0004oM-At for bug-gnu-emacs@gnu.org; Mon, 15 Jan 2007 23:03:30 -0500 Original-Received: from [62.212.121.106] (helo=prunille.vinc17.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H6fXk-0001Jh-Fh for bug-gnu-emacs@gnu.org; Mon, 15 Jan 2007 23:03:28 -0500 Original-Received: by prunille.vinc17.org (Postfix, from userid 501) id D758E102DD54; Tue, 16 Jan 2007 05:03:27 +0100 (CET) Original-To: bug-gnu-emacs@gnu.org Content-Disposition: inline X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.13-vl-r14963 (2007-01-09) X-Mailman-Approved-At: Tue, 16 Jan 2007 00:30:47 -0500 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:15530 Archived-At: Hi, I get strange results with flush-lines. The first one may be due to a lack of clear documentation, but I'm pretty sure the second one is a bug. The following tests have been done with GNU Emacs 22.0.50.1 under Mac OS X (MacPorts) and with GNU Emacs 22.0.92.1 under GNU/Linux (Debian package emacs-snapshot). 1. Consider the following file: -------------------- > test 1 > foo =20 blah > test 2 > foo > foobar blah -------------------- where the cursor is a the top. I evaluate (with "M-:") the following: (flush-lines "^\\(> \n\\)*> foo\n\\(\n?> .*\\)*") and I get: -------------------- > test 1 blah > test 2 blah -------------------- instead of -------------------- > test 1 blah > test 2 blah -------------------- I'd say that the blank line shouldn't be deleted because nothing is matched on it. But the end point is on this line, so I'm not sure. The flush-lines documentation is not clear about that. 2. Now consider the following file: -------------------- > test 1 > foo blah > test 2 > foo > bar > foobar blah > test 3 > foobar blah -------------------- (flush-lines "^\\(> \n\\)*> foo$\\(\n> .*\\)*") has no effect on it. (flush-lines "^\\(> \n\\)*> foo\\($\\|\\(\n> .*\\)+\\)") doesn't have any effect either, but if I permute the both sides of the "|", i.e. (flush-lines "^\\(> \n\\)*> foo\\(\\(\n> .*\\)+\\|$\\)") then I get: -------------------- > test 1 blah > test 2 blah > test 3 > foobar blah -------------------- as expected. Regards, --=20 Vincent Lef=E8vre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)