From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Whitespace search and regex.c Date: Sun, 05 Dec 2004 17:33:18 +0200 Organization: JURTA Message-ID: <87vfbgahfl.fsf@jurta.org> References: <87y8gq9da4.fsf-monnier+emacs@gnu.org> <87wtw8tggj.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1102261127 22291 80.91.229.6 (5 Dec 2004 15:38:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 5 Dec 2004 15:38:47 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 05 16:38:39 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CayT9-0006X9-00 for ; Sun, 05 Dec 2004 16:38:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Caycq-0008OJ-Kc for ged-emacs-devel@m.gmane.org; Sun, 05 Dec 2004 10:48:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CaycZ-0008Mm-0r for emacs-devel@gnu.org; Sun, 05 Dec 2004 10:48:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CaycY-0008MD-GV for emacs-devel@gnu.org; Sun, 05 Dec 2004 10:48:22 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CaycY-0008M3-DR for emacs-devel@gnu.org; Sun, 05 Dec 2004 10:48:22 -0500 Original-Received: from [194.126.101.102] (helo=MXR-4.estpak.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CaySc-00028H-12; Sun, 05 Dec 2004 10:38:06 -0500 Original-Received: from mail.neti.ee (80-235-35-192-dsl.mus.estpak.ee [80.235.35.192]) by MXR-4.estpak.ee (Postfix) with ESMTP id 913DDBD9EC; Sun, 5 Dec 2004 17:38:00 +0200 (EET) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Mon, 29 Nov 2004 01:12:20 -0500") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at neti.ee 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: main.gmane.org gmane.emacs.devel:30697 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30697 I have no strong opinion on whether changing regex.c was a good thing or not (after all, Perl already entered on the same path where its regexp engine is modified every time someone fells a need to add a new feature. BTW, setting `search-spaces-regexp' to the empty string would allow to improve Emacs regexp readability similar to the /x modifier in Perl regexps. I won't elaborate on how useful it is, but I always wished that Emacs regexps would use features of Perl regexps). Anyhow, I want to note that there is a bug in the current implementation of `search-spaces-regexp' feature. The space at the end of a regexp is interpreted literally, not as a whitespace specified by `search-spaces-regexp'. Whereas the space in the middle or at the beginning of a regexp is interpreted correctly (i.e. as a special whitespace character). Test case: (let ((search-spaces-regexp "\\s-+")) (re-search-forward "a b")) finds the first line in the test text below (CORRECT). (let ((search-spaces-regexp "\\s-+")) (re-search-forward "a ")) finds the second line in the test text below (INCORRECT, it should find the first line). Test text: a b (has TAB between `a' and `b') a b (has SPC between `a' and `b') -- Juri Linkov http://www.jurta.org/emacs/