From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philippe Delavalade Newsgroups: gmane.emacs.help Subject: Re: Problem with whitespaces in search Date: Thu, 28 Jan 2016 16:36:34 +0100 Message-ID: <20160128153634.GA1737@magellan.home> References: <20160128101634.GA1641@magellan.home> <20160128231755467878936@bob.proulx.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1453995433 26370 80.91.229.3 (28 Jan 2016 15:37:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Jan 2016 15:37:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 28 16:37:04 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 1aOod5-0006MR-2x for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Jan 2016 16:37:03 +0100 Original-Received: from localhost ([::1]:57315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOod4-0000wZ-It for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Jan 2016 10:37:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOocl-0000vs-LV for help-gnu-emacs@gnu.org; Thu, 28 Jan 2016 10:36:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOoci-0003rc-Eb for help-gnu-emacs@gnu.org; Thu, 28 Jan 2016 10:36:43 -0500 Original-Received: from smtp06.smtpout.orange.fr ([80.12.242.128]:51075 helo=smtp.smtpout.orange.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOoci-0003rG-4V for help-gnu-emacs@gnu.org; Thu, 28 Jan 2016 10:36:40 -0500 Original-Received: from localhost ([86.212.236.141]) by mwinf5d63 with ME id BTcb1s00333jeyW03TcbmR; Thu, 28 Jan 2016 16:36:38 +0100 X-ME-Helo: localhost X-ME-Date: Thu, 28 Jan 2016 16:36:38 +0100 X-ME-IP: 86.212.236.141 Content-Disposition: inline In-Reply-To: <20160128231755467878936@bob.proulx.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.12.242.128 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:108896 Archived-At: Le jeudi 28 janvier à 16:24, Bob Proulx a écrit : > 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 `]+'. Thanks Bob. I was wishing to find sequence of whitespaces ; so I followed Tomas help and put (setq isearch-lax-whitespace nil) in .emacs and now I have what I expect. I'll have a look to your link. For regexp, it was working 'normally' for me :-) Regards. -- Ph. Delavalade