Subject: bug#22494: still can't search for two spaces

From: Drew Adams <[email-masked]>
Date: Sat, 30 Jan 2016 16:02:29 -0800 (PST)

> >>   > > I still can't search for two spaces with C-s SPC SPC.
> >>   > > It still just sits on the first match for single space.
> >>
> >>   > Crystal ball says you didn't read the manual, which explains that you
> >>   > need to type M-s SPC after C-s to get what you want (which is literal
> >>   > space matching).
> >>
> >> This is a bug.  When the user types SPC SPC in a search string,
> >> person clearly wants to search for two spaces.  It should do that.
> >
> > +1
> 
> +1
> 
> > And then what if the user made a mistake typing that second SPC
> > char - i.e., didn't really mean to search literally for multiple
> > whitespace chars?  It won't be enough to just delete the second
> > SPC char (but the user might try that).
> 
> Why couldn't it be enough?

It's not a clear indication that the user wants to return to
lax whitespace matching.  What if s?he deleted the second SPC
and typed a TAB or other whitespace char?  Or typed a SPC char
again?  Would you toggle back again?

More than one whitespace char in a row might be sufficient cause
to switch to literal whitespace matching, but it's not clear that
a single such char is sufficient cause to switch to lax matching.

I'd propose a clear message indicating that Emacs has guessed,
because you typed more than one whitespace char in a row, that
you really want literal whitespace char matching, and so it has
switched to that mode.  And at the same time indicate that you
can toggle the whitespace-matching behavior using `M-s SPC'.
That should be clear enough, I would think.