emacs-devel
[Top][All Lists]
Advanced

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

lax matching is not a great default behavior


From: Drew Adams
Subject: lax matching is not a great default behavior
Date: Fri, 27 Nov 2015 21:04:54 -0800 (PST)

This has been discussed somewhat, but I don't think there was
any actual proposal to change the behavior.  So here goes.

Does it still make sense to make search and replacement
use lax matching, i.e., fold stuff, by default?

I don't think it does.  I think that users, especially
new users, would be less confused if Emacs defaulted to
literal searching - no whitespace, case, "character",
or other folding by default.

Folding features and their combinations and customizations
will only increase in the future (at least I hope so -
that's a good thing).  The starting point that is the
least ambiguous, least surprising, and least difficult for
a user to discover and understand is zero folding: literal
search.

I realize that this would change the longstanding practice
of having letter-case folding be default.  I think that
choice made sense back when most programming languages and
OS's did not have a letter-case difference.  But I don't
think it is the best choice for the default behavior now.

Same for whitespace folding, though that is not longstanding.

Even more so for "character" folding, i.e., ignoring
diacriticals and differences among quote marks etc. (and
some other ad hoc equivalences).  Such classes might be
clear to those who are familiar with them, and this folding
feature can certainly be useful.  But I don't think it is
the right choice for the default behavior.

Literal search is dead simple, plain, obvious, boring, clear.

Anyone who wants to go further, and fold whitespace, for
instance, can easily ask Emacs how to do that and find out
that there is a simple toggle key for it.  Starting with
whitespace folding turned on, on the other hand, can be
confusing, particularly for programmers, who often care
about which whitespace chars, and how many, they are
searching for.

Similarly for case fold.  Let's start with WYTIWYSF: what
you type is what you search for.  Anyone who wants to
abstract from letter case can easily ask Emacs how to do
that and find out that a simple toggle key suffices.

(Yes, there is also the "clever" complication of automatic
case-fold-search change when an upper-case char is present.
I don't propose any change in that regard now, but I do
think that its time is also soon up.  Not so useful as a
default behavior, IMO.  And I don't think it was a great
idea to copy the same cleverness for "character" folding.
But this is a different story.)

It's likely I won't have more to say about this.  I think
the pros & cons are pretty straightforward.  It's more a
question of choosing than arguing reasons at this point,
I expect.



reply via email to

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