From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: Problem with whitespaces in search Date: Thu, 28 Jan 2016 23:24:27 +0800 Message-ID: <20160128231755467878936@bob.proulx.com> References: <20160128101634.GA1641@magellan.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1453994699 13466 80.91.229.3 (28 Jan 2016 15:24:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Jan 2016 15:24:59 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Philippe Delavalade Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 28 16:24:51 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aOoRH-0003nX-2T for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Jan 2016 16:24:51 +0100 Original-Received: from localhost ([::1]:57232 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOoRG-0007iF-19 for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Jan 2016 10:24:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOoQy-0007el-6y for help-gnu-emacs@gnu.org; Thu, 28 Jan 2016 10:24:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOoQu-0000Nt-VG for help-gnu-emacs@gnu.org; Thu, 28 Jan 2016 10:24:32 -0500 Original-Received: from havoc.proulx.com ([96.88.95.61]:47084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOoQu-0000NA-R8 for help-gnu-emacs@gnu.org; Thu, 28 Jan 2016 10:24:28 -0500 Original-Received: from joseki.proulx.com (localhost [127.0.0.1]) by havoc.proulx.com (Postfix) with ESMTP id 1B680AE5; Thu, 28 Jan 2016 08:24:28 -0700 (MST) Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 8D0E421862; Thu, 28 Jan 2016 08:24:27 -0700 (MST) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id 67F7C2DC61; Thu, 28 Jan 2016 08:24:27 -0700 (MST) Mail-Followup-To: Philippe Delavalade , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <20160128101634.GA1641@magellan.home> User-Agent: Mutt/1.5.24 (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 96.88.95.61 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108893 Archived-At: Philippe Delavalade wrote: > I have just noticed a problem when searching whitespaces. I'm using version > 24.3.1 under linux/slackware 14.1. > > For instance, with a file containing the unique line > > abcd fghix jklmxx nopqxxx > > and with the cursor on column 0, when searching whitespaces (incremental or > not), the cursor comes under the 'f' which is normal but it stays their > even when typing many ' '. > > This does not happen with 'x' for instance. > > What can I do to avoid this and find many whitespaces ? > > I hope have been clear and sorry for my poor english. This is a case where something that is a feature for one person is a bug to another person. I always disable "lax space matching" myself. This is documented here: https://www.gnu.org/software/emacs/manual/html_node/emacs/Special-Isearch.html It isn't clear exactly what you are wishing. You might be wanting to set search-whitespace-regexp to nil to disable the feature? (setq search-whitespace-regexp nil) See also the builtin documentation on search-whitespace-regexp. (describe-variable 'search-whitespace-regexp) search-whitespace-regexp is a variable defined in `isearch.el'. Its value is nil Original value was "\\s-+" Documentation: If non-nil, regular expression to match a sequence of whitespace chars. When you enter a space or spaces in the incremental search, it will match any sequence matched by this regexp. As an exception, spaces are treated normally in regexp incremental search if they occur in a regexp construct like [...] or *, + or ?. If the value is a string, it applies to both ordinary and regexp incremental search. If the value is nil, or `isearch-lax-whitespace' is nil for ordinary incremental search, or `isearch-regexp-lax-whitespace' is nil for regexp incremental search, then each space you type matches literally, against one space. You might want to use something like "[ \t\r\n]+" instead. In the Customization buffer, that is `[' followed by a space, a tab, a carriage return (control-M), a newline, and `]+'. Bob