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: Re: search-whitespace-regexp Date: Fri, 04 Feb 2005 10:17:14 -0500 Message-ID: References: <1982.220.255.95.17.1107526353.squirrel@220.255.95.17> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1107532062 30245 80.91.229.2 (4 Feb 2005 15:47:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 4 Feb 2005 15:47:42 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 04 16:47:42 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Cx5gE-00033S-Mu for ged-emacs-devel@m.gmane.org; Fri, 04 Feb 2005 16:47:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cx5tm-0000Uh-53 for ged-emacs-devel@m.gmane.org; Fri, 04 Feb 2005 11:01:34 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Cx5tc-0000U6-Go for emacs-devel@gnu.org; Fri, 04 Feb 2005 11:01:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Cx5ta-0000Tu-WE for emacs-devel@gnu.org; Fri, 04 Feb 2005 11:01:24 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cx5sh-0000GU-69 for emacs-devel@gnu.org; Fri, 04 Feb 2005 11:00:27 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Cx5Cx-0004z6-Rh for emacs-devel@gnu.org; Fri, 04 Feb 2005 10:17:20 -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 8B3A68282A3; Fri, 4 Feb 2005 10:17:18 -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 0BE424AC16A; Fri, 4 Feb 2005 10:17:15 -0500 (EST) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id E9CF64C20C; Fri, 4 Feb 2005 10:17:14 -0500 (EST) Original-To: "Chong Yidong" In-Reply-To: <1982.220.255.95.17.1107526353.squirrel@220.255.95.17> (Chong Yidong's message of "Fri, 4 Feb 2005 09:12:33 -0500 (EST)") 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=-4.78, requis 5, autolearn=not spam, AWL 0.12, BAYES_00 -4.90) 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 X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:32873 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32873 > --- 2023,2043 ---- > (isearch-regexp > (if isearch-forward 're-search-forward 're-search-backward)) > (t > ! (if isearch-forward 'isearch-search-forward > 'isearch-search-backward))))) > ! > ! (defun isearch-search-forward (string &optional bound noerror count) > ! (re-search-forward > ! (if search-whitespace-regexp > ! (replace-regexp-in-string " +" search-whitespace-regexp string) > ! string) > ! bound noerror count)) > ! > ! (defun isearch-search-backward (string &optional bound noerror count) > ! (re-search-backward > ! (if search-whitespace-regexp > ! (replace-regexp-in-string " +" search-whitespace-regexp string) > ! string) > ! bound noerror count)) I generally agree with your proposal to change the behavior of isearch such that only plain search uses a "magical space", whereas regexp search is made more "raw". But the above code is wrong in that it fails to quote chars like "[" in the search string. You probably want to use something like (re-search-forward (mapconcat 'regexp-quote (split-string string) search-whitespace-regexp) bound noerror count) instead, Stefan