* Problem with whitespaces in search
@ 2016-01-28 10:16 Philippe Delavalade
2016-01-28 13:48 ` tomas
2016-01-28 15:24 ` Bob Proulx
0 siblings, 2 replies; 9+ messages in thread
From: Philippe Delavalade @ 2016-01-28 10:16 UTC (permalink / raw)
To: help-gnu-emacs
Hi.
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.
Regards.
--
Ph. Delavalade
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problem with whitespaces in search
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
[not found] ` <20160128144901.GA1588@magellan.home>
2016-01-28 15:24 ` Bob Proulx
1 sibling, 2 replies; 9+ messages in thread
From: tomas @ 2016-01-28 13:48 UTC (permalink / raw)
To: help-gnu-emacs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, Jan 28, 2016 at 11:16:34AM +0100, Philippe Delavalade wrote:
> Hi.
>
> 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 ' '.
In "incremental search" (I'm assuming from context you are using that), any
whitespace you enter will match a sequence of one or more whitespaces.
You can change this behaviour by setting the variable "isearch-lax-whitespace"
to nil (there is a command for that, "isearch-toggle-lax-whitespace").
Try M-x isearch-toggle-lax-whitespace to change that.
hth
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAlaqHEYACgkQBcgs9XrR2kYVFQCfdENCnOpk7i/BtfTVOsYOflxv
8JsAnjD3xvFyO97XcNAInt5a21ulbJcm
=sVCc
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: Problem with whitespaces in search
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>
1 sibling, 1 reply; 9+ messages in thread
From: Ludwig, Mark @ 2016-01-28 14:46 UTC (permalink / raw)
To: tomas@tuxteam.de, help-gnu-emacs@gnu.org
> From: tomas@tuxteam.de, Thursday, January 28, 2016 7:49 AM
>
> On Thu, Jan 28, 2016 at 11:16:34AM +0100, Philippe Delavalade wrote:
> > Hi.
> >
> > 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 ' '.
>
> In "incremental search" (I'm assuming from context you are using that), any
> whitespace you enter will match a sequence of one or more whitespaces.
>
> You can change this behaviour by setting the variable "isearch-lax-whitespace"
> to nil (there is a command for that, "isearch-toggle-lax-whitespace").
>
> Try M-x isearch-toggle-lax-whitespace to change that.
>
> hth
> - -- t
I'm running Emacs 24.2.1, with the same behavior.
I don't see any variable with any similar name.
I've tried Apropos both "isearch" and "whitespace" and don't see anything.
Thanks,
Mark
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problem with whitespaces in search
2016-01-28 14:46 ` Ludwig, Mark
@ 2016-01-28 14:56 ` tomas
0 siblings, 0 replies; 9+ messages in thread
From: tomas @ 2016-01-28 14:56 UTC (permalink / raw)
To: Ludwig, Mark; +Cc: help-gnu-emacs@gnu.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, Jan 28, 2016 at 02:46:09PM +0000, Ludwig, Mark wrote:
>
>
> > From: tomas@tuxteam.de, Thursday, January 28, 2016 7:49 AM
> > [isearch-lax-whitespace]
[...]
> I'm running Emacs 24.2.1, with the same behavior.
> I don't see any variable with any similar name.
>
> I've tried Apropos both "isearch" and "whitespace" and don't see anything.
Hm. I've got 25.0.50. No access to repos, so I don't know when
this var was introduced, sorry :-(
regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAlaqLBEACgkQBcgs9XrR2kaD7QCeOMvPJtno//+j80ei/vzgY/9O
+SAAn0zzbR0wHeOCFY6If/MTwT/JAz1K
=wYs2
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problem with whitespaces in search
[not found] ` <20160128144901.GA1588@magellan.home>
@ 2016-01-28 14:58 ` tomas
0 siblings, 0 replies; 9+ messages in thread
From: tomas @ 2016-01-28 14:58 UTC (permalink / raw)
To: Philippe Delavalade; +Cc: help-gnu-emacs@gnu.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, Jan 28, 2016 at 03:49:01PM +0100, Philippe Delavalade wrote:
> Le jeudi 28 janvier à 14:48, tomas@tuxteam.de a écrit :
> > On Thu, Jan 28, 2016 at 11:16:34AM +0100, Philippe Delavalade wrote:
> > > Hi.
> > >
> > > I have just noticed a problem when searching whitespaces. I'm using version
> > > 24.3.1 under linux/slackware 14.1.
[...]
> > Try M-x isearch-toggle-lax-whitespace to change that.
>
> Thank you so much ; now things go like I expect. Is this new ? I'm using
> emacs since many years and that's the first time I notice this.
You're welcome :-)
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAlaqLIUACgkQBcgs9XrR2kZWewCdG28RBqCxL5FvRSPpzaPKKtHJ
gbQAn27KMA8fW9hLwkYbYeURobTjXEl9
=srK/
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problem with whitespaces in search
2016-01-28 10:16 Problem with whitespaces in search Philippe Delavalade
2016-01-28 13:48 ` tomas
@ 2016-01-28 15:24 ` Bob Proulx
2016-01-28 15:36 ` Philippe Delavalade
1 sibling, 1 reply; 9+ messages in thread
From: Bob Proulx @ 2016-01-28 15:24 UTC (permalink / raw)
To: Philippe Delavalade; +Cc: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problem with whitespaces in search
2016-01-28 15:24 ` Bob Proulx
@ 2016-01-28 15:36 ` Philippe Delavalade
2016-01-28 16:00 ` Drew Adams
0 siblings, 1 reply; 9+ messages in thread
From: Philippe Delavalade @ 2016-01-28 15:36 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: Problem with whitespaces in search
2016-01-28 15:36 ` Philippe Delavalade
@ 2016-01-28 16:00 ` Drew Adams
2016-01-29 7:32 ` tomas
0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2016-01-28 16:00 UTC (permalink / raw)
To: Philippe Delavalade, help-gnu-emacs
> > 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
>
> 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.
You can toggle the whitespace-matching behavior during Isearch using
`M-s SPC' (command `isearch-toggle-lax-whitespace').
The doc string of `isearch-lax-whitespace' should tell you this directly,
but it says only that you can use `isearch-toggle-lax-whitespace'. It
does not tell you that this command is bound to `M-s SPC' during Isearch.
I've just now filed bug #22483 for this oversight.
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22483
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problem with whitespaces in search
2016-01-28 16:00 ` Drew Adams
@ 2016-01-29 7:32 ` tomas
0 siblings, 0 replies; 9+ messages in thread
From: tomas @ 2016-01-29 7:32 UTC (permalink / raw)
To: help-gnu-emacs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, Jan 28, 2016 at 08:00:45AM -0800, Drew Adams wrote:
> > > 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
> >
> > 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.
>
> You can toggle the whitespace-matching behavior during Isearch using
> `M-s SPC' (command `isearch-toggle-lax-whitespace').
Nifty! I didn't know about that one. Thanks, Drew
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAlarFYAACgkQBcgs9XrR2kbpfQCcCIao92LRdb40jIXs7I5KxLTL
LssAnAqE9Rei1+EOynKiQ6ZL8sXalsRv
=c5q0
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-01-29 7:32 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-01-28 16:00 ` Drew Adams
2016-01-29 7:32 ` tomas
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).