From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Whitespace search and regex.c Date: Mon, 22 Nov 2004 12:24:26 -0500 Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1101145249 28128 80.91.229.6 (22 Nov 2004 17:40:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 22 Nov 2004 17:40:49 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 22 18:40:38 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 1CWHvy-0000vc-00 for ; Mon, 22 Nov 2004 18:25:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CWI51-0003IM-Ph for ged-emacs-devel@m.gmane.org; Mon, 22 Nov 2004 12:34:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CWI4q-0003I4-Ox for emacs-devel@gnu.org; Mon, 22 Nov 2004 12:34:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CWI4q-0003Hs-3B for emacs-devel@gnu.org; Mon, 22 Nov 2004 12:34:12 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CWI4p-0003Hp-Qn for emacs-devel@gnu.org; Mon, 22 Nov 2004 12:34:11 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CWHvU-0007vV-Rt for emacs-devel@gnu.org; Mon, 22 Nov 2004 12:24:32 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 973E88282BE; Mon, 22 Nov 2004 12:24:32 -0500 (EST) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 511EC4AC503; Mon, 22 Nov 2004 12:24:27 -0500 (EST) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 3E8288CA69; Mon, 22 Nov 2004 12:24:27 -0500 (EST) Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=0, requis 5) X-MailScanner-From: monnier@iro.umontreal.ca 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:30259 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30259 What is this recent change to regex.c w.r.t whitespace search all about? This is really ugly. As best as I can tell, this is to avoid the problem where (replace-regexp-in-string " " "\\(?:\s-+\\)" ...) does not give the right result because the " " could be inside brackets. I think that changing regex.c for this one special case is a mistake. Not only because it dirties up the regex.[ch] abstraction even further by adding yet a bit more Emacs specific code in regex.[ch]. After all this problem manifests itself at a few other places (such as regexp-opt-depth) as well. So I think a more general solution would be much more useful and cleaner. E.g. a function (parse-partial-regex REGEXP POS) which would return a value indicating whether POS is within brackets or not. Stefan