emacs-devel
[Top][All Lists]
Advanced

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

RE: search-whitespace-regexp


From: Drew Adams
Subject: RE: search-whitespace-regexp
Date: Sun, 6 Feb 2005 16:28:33 -0800

    > > sometimes the actual whitespace matters.
    > Right: in *regexp* search.

    while people generally expect regexp searches to be a bit fuzzy, they
    might expect a non-regexp search to be exact. Since the fuzzy
    whitespace matching often "looks" like normal matching (because the
    majority of whitespace is in fact a single space), it might take some
    time to see what's going on, resulting in some subtle errors.
    This is particularly true if one embeds a search inside a keyboard
    macro [which I often do].

Plain (incremental) search should be a literal search. Regexp search should
rigorously respect the regexp. People don't expect either to be fuzzy.

The question is "Under what circumstances should typing a space be
interpreted as wanting to search for any amount of whitespace?"

This is unrelated to both plain search and regexp search. You might or might
not want this _input effect_ with either plain or regexp search.

This is akin to word search (as I think someone mentioned). Ultimately, a
word search or a space-means-whitespace search is implemented with a regexp
search - but the point in both cases is to provide a user-friendly way to do
it, instead of requiring users to know about regexps.

By default, neither `C-M-s' nor `C-s' should respect the user-friendly
space-input feature. Or, rather, the default behavior of each should be
determined by a user option - a la case-fold-search. And, regardless of the
value of this option, you should be able to toggle space-means-whitespace
searching from both `C-M-s' and `C-s', via a key sequence.

The question then becomes how to toggle this space-means-whitespace
searching? An obvious candidate is `C-s C-SPC'. (Some will no doubt argue
against this because it means you can't just end a search and set the mark
this way.)





reply via email to

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