From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Chong Yidong" Newsgroups: gmane.emacs.devel Subject: Re: search-whitespace-regexp Date: Sat, 5 Feb 2005 20:59:46 -0500 (EST) Message-ID: <35379.203.116.59.24.1107655186.squirrel@203.116.59.24> 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=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1107656053 30944 80.91.229.2 (6 Feb 2005 02:14:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 6 Feb 2005 02:14:13 +0000 (UTC) Cc: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 06 03:14:13 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Cxbw6-0008Hl-33 for ged-emacs-devel@m.gmane.org; Sun, 06 Feb 2005 03:14:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cxc9v-0001HT-Ki for ged-emacs-devel@m.gmane.org; Sat, 05 Feb 2005 21:28:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Cxc83-0000TQ-2H for emacs-devel@gnu.org; Sat, 05 Feb 2005 21:26:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Cxc7u-0000Nt-NN for emacs-devel@gnu.org; Sat, 05 Feb 2005 21:26:23 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cxc7n-0000Hf-Sk for emacs-devel@gnu.org; Sat, 05 Feb 2005 21:26:11 -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 1CxbiS-0003Wl-UB; Sat, 05 Feb 2005 21:00:01 -0500 Original-Received: from stupidch by shark.dnsvelocity.com with local (Exim 4.43) id 1CxbiE-0007Tt-GC; Sat, 05 Feb 2005 20:59:46 -0500 Original-Received: from 203.116.59.24 ([203.116.59.24]) (SquirrelMail authenticated user cyd@stupidchicken.com); by stupidchicken.com with HTTP; Sat, 5 Feb 2005 20:59:46 -0500 (EST) In-Reply-To: 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 - shark.dnsvelocity.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: stupidchicken.com:/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: main.gmane.org gmane.emacs.devel:32927 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32927 > However, I believe that > using search-whitespace-regexp in isearch-forward-regexp is a > misfeature. It should instead be used for isearch-forward. > > For years, string search has treated characters literally while regexp > search has treated space as "any whitespace". To reverse this would > be an incompatible change that would affect every user. > > I think you're the first person ever to ask for this change. I think > it would cause more trouble than benefit. > > However, if a poll of users is done, and we find that most users would > prefer this change, I would consider it. In that case, I propose just changing string search, using a variable search-whitespace, analogous to search-whitespace-regexp. This should default to nil, so that the default behavior of string search is identical to Emacs 21.3 and below. If the user customizes the value, he gets the "magical space" behavior. I have come across several complaints about newlines interfering with string search. For example, a website called "Emacs for Writers", which is written by a professional writer and non-programmer who uses Emacs, says this: http://www.therandymon.com/linux/woodnotes/emacswriter/node15.html One limitation of regular searches in documents that have been formatted (filled) is that if the two words are separated by a newline, the incremental search function won't find them. He goes on to recommend using word search, but the problem with word search is that it is not incremental. As I have mentioned, regular expression search is also problematic for casual use, especially if the user is unfamiliar with regexp syntax, because characters like "." have special meaning. A cursory search through Google turned up indicates that there have been plenty of user requests for something like this over the years. For example: http://groups.google.com.sg/groups?selm=199803011846.NAA30567%40feedback.princeton.edu&output=gplain I edit tex documents (such as my thesis), and I usually find locations in a document using isearch (^S). Searching for a couple words in a row (say "the dog") is usually enough to narrow down the location. However, if "the" and "dog" are separated by a newline, then isearch won't find them... Is there a totally different approach that would make plain iserach smart enough to understand that SPACE could be a newline (or a tab)? The advantage of using plain isearch instead of regexp isearch is that I wouldn't have to escape special characters like "[".