[Top][All Lists]

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

Re: Interpretation of a space in regexp isearch?

From: Davis Herring
Subject: Re: Interpretation of a space in regexp isearch?
Date: Wed, 15 Aug 2012 08:31:31 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110717 Lanikai/3.1.11

> We've been through this before, I think, but...
> By default, "magic-space" searching should be OFF for both simple and regexp
> search.  Each SPC you type should search for a single SPC, by default.  
> Simple.
> No surprise.

Unless you filled a paragraph (perhaps via auto-fill-mode) and don't
remember doing so.

> Others have given reasons for the regexp case (+1).  For the simple-search 
> case:
> I do not think it is appropriate for users, especially newbies, to have to
> figure out and use `C-q SPC' (WTF?) to search for a single SPC char.

If you're searching just for a space, the only differences will be that
you stop only once at each stretch of whitespace (and that you stop at
all at (sequences of) tabs, which, as common as they are, are still
almost always rare compared to spaces).  Why would you even care?  Sure,
if you're searching for "a b" you'll find "a  b", but when would you
search for that, caring about missing the latter, and not be using a
regexp (as to find sentences with only one space separating them)?

> I do agree, however, that magic-space searching can be very useful, and it
> should be easily available, via a toggle key, for both simple and regexp
> searching.

Is "let's add an isearch toggle key" what you meant by "We've been
through this before"?

> * Treat both simple and regexp search the same way.

In regexp search, you can choose between \s-+ and SPC -- that's why so
many have said just now that this magic is appropriate for C-s and not

> * Have a toggle key that flips the Boolean value.
>   The new value stays in effect (including in future
>   searches for the same session) until flipped again.
>   (Some candidates for the key: `M-SPC', `M-s SPC'.)

How is M-SPC any easier than C-q?  (This is an argument for having the
default be "on" for this magic; otherwise you need a way to summon it
for one use and C-q doesn't fit there.)  As always, adding keys to
isearch reduces the set you can use on exit (M-SPC is useful here).

> * Users can set the variable value in their init files, if
>   they want to change the default (i.e., initial) behavior.

Er, yes?


This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during

reply via email to

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