From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Chong Yidong" Newsgroups: gmane.emacs.devel Subject: isearch magic space Date: Tue, 15 Mar 2005 06:14:13 -0500 (EST) Message-ID: <1491.220.255.169.59.1110885253.squirrel@220.255.169.59> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1110888359 31814 80.91.229.2 (15 Mar 2005 12:05:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 15 Mar 2005 12:05:59 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 15 13:05:58 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DBAnz-0005Tg-Mb for ged-emacs-devel@m.gmane.org; Tue, 15 Mar 2005 13:05:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DBB3s-0006JR-07 for ged-emacs-devel@m.gmane.org; Tue, 15 Mar 2005 07:22:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DBAag-00078k-2s for emacs-devel@gnu.org; Tue, 15 Mar 2005 06:52:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DBAXg-0006U7-2b for emacs-devel@gnu.org; Tue, 15 Mar 2005 06:48:56 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DBAVy-00062V-3h for emacs-devel@gnu.org; Tue, 15 Mar 2005 06:47:10 -0500 Original-Received: from [64.21.80.18] (helo=shark.dnsvelocity.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1DBA09-00051k-50 for emacs-devel@gnu.org; Tue, 15 Mar 2005 06:14:17 -0500 Original-Received: from stupidch by shark.dnsvelocity.com with local (Exim 4.44) id 1DBA05-0003Jq-5U for emacs-devel@gnu.org; Tue, 15 Mar 2005 06:14:13 -0500 Original-Received: from 220.255.169.59 ([220.255.169.59]) (SquirrelMail authenticated user cyd@stupidchicken.com); by www.stupidchicken.com with HTTP; Tue, 15 Mar 2005 06:14:13 -0500 (EST) Original-To: emacs-devel@gnu.org User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a X-Priority: 3 (Normal) Importance: Normal X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - shark.dnsvelocity.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [32675 33085] / [47 12] X-AntiAbuse: Sender Address Domain - stupidchicken.com X-Source: /usr/local/cpanel/3rdparty/bin/php X-Source-Args: /usr/local/cpanel/3rdparty/bin/php /usr/local/cpanel/base/3rdparty/squirrelmail/src/compose.php X-Source-Dir: :/base/3rdparty/squirrelmail/src 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: news.gmane.org gmane.emacs.devel:34599 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34599 Some time ago, I proposed providing a magic space for ordinary isearch. The response was generally favorable, but my papers were not in order, so the patch could not be applied. My copyright assignment is settled now; can the patch be applied, or is it too late? *** emacs/lisp/isearch.el~ Tue Mar 15 19:06:42 2005 --- emacs/lisp/isearch.el Tue Mar 15 19:15:49 2005 *************** *** 109,114 **** --- 109,123 ---- :type 'boolean :group 'isearch) + (defcustom search-string-whitespace-regexp "[ \t\r\n]+" + "*If non-nil, regular expression to match a sequence of whitespace chars. + This applies to ordinary (string) incremental search. When you + put a space or spaces in the incremental regexp, it stands for + this, unless it is inside of a regexp construct such as [...] + or *, + or ?." + :type 'regexp + :group 'isearch) + (defcustom search-whitespace-regexp "\\s-+" "*If non-nil, regular expression to match a sequence of whitespace chars. This applies to regular expression incremental search. *************** *** 2027,2033 **** (isearch-regexp (if isearch-forward 're-search-forward 're-search-backward)) (t ! (if isearch-forward 'search-forward 'search-backward))))) (defun isearch-search () ;; Do the search with the current search string. --- 2036,2051 ---- (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) ! (let ((search-spaces-regexp search-string-whitespace-regexp)) ! (re-search-forward (regexp-quote string) bound noerror count))) ! ! (defun isearch-search-backward (string &optional bound noerror count) ! (let ((search-spaces-regexp search-string-whitespace-regexp)) ! (re-search-backward (regexp-quote string) bound noerror count))) (defun isearch-search () ;; Do the search with the current search string.