[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with whitespaces in search

From: Bob Proulx
Subject: Re: Problem with whitespaces in search
Date: Thu, 28 Jan 2016 23:24:27 +0800
User-agent: Mutt/1.5.24 (2015-08-30)

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:

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-+"

  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 `]+'.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]