From: Philippe Delavalade <philippe.delavalade@orange.fr>
To: help-gnu-emacs@gnu.org
Subject: Re: Problem with whitespaces in search
Date: Thu, 28 Jan 2016 16:36:34 +0100 [thread overview]
Message-ID: <20160128153634.GA1737@magellan.home> (raw)
In-Reply-To: <20160128231755467878936@bob.proulx.com>
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
next prev parent reply other threads:[~2016-01-28 15:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-28 10:16 Problem with whitespaces in search Philippe Delavalade
2016-01-28 13:48 ` tomas
2016-01-28 14:46 ` Ludwig, Mark
2016-01-28 14:56 ` tomas
[not found] ` <20160128144901.GA1588@magellan.home>
2016-01-28 14:58 ` tomas
2016-01-28 15:24 ` Bob Proulx
2016-01-28 15:36 ` Philippe Delavalade [this message]
2016-01-28 16:00 ` Drew Adams
2016-01-29 7:32 ` tomas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160128153634.GA1737@magellan.home \
--to=philippe.delavalade@orange.fr \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).