unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Nix <nix@esperi.org.uk>
Cc: Jean-Christophe Helary <jean.christophe.helary@gmail.com>,
	bruce.connor.am@gmail.com, emacs-devel <emacs-devel@gnu.org>
Subject: RE: char equivalence classes in search - why not symmetric?
Date: Mon, 7 Sep 2015 10:07:10 -0700 (PDT)	[thread overview]
Message-ID: <573d297e-730f-46b6-9290-624b9497c501@default> (raw)
In-Reply-To: <87k2s25oaz.fsf@esperi.org.uk>

> FWIW I just introduced Emacs to a newbie last month -- using trunk Emacs
> because that's what I happened to have available. She was very happy
> indeed about not only isearch, not only case-fold search but
> specifically char-fold search, and she writes stuff using diacritics all
> the time.
> 
> The key to remember here is that there are many use cases in which it is
> better if isearch finds something similar to what you typed than if it
> misses something you were looking for: you can always hit C-s again!
> So thanks to case-fold and char-fold search she doesn't have to worry
> about getting either the case or diacritics right, and can cut down on
> chording and compose characters while searching.
> 
> So that's one newbie in particular who would vociferously disagree
> with you.
> 
> > What should be done is to have simple, obvious default behavior,
                                                   ^^^^^^^
> She found "searching ignores accent-like things and case" to be easy
> and instantly understandable, even though the implementation of
> ignoring even case is (thanks to case-conversion tables) quite
> complicated in a Unicode world.

Anecdotal evidence from one newbie.  OK.

I don't see anything in your description of her understanding of
Isearch that shows that she "would vociferously disagree" with
my proposition that literal search is a better default behavior,
but I guess that is how you feel.  So be it.

Nevertheless, I wonder a bit about her nonsurprise and instant
understanding wrt char folding.  Did she just search for
something like `a' and find things like `á'?  Or did she also
search for something like `á' and find things like `a'?  (She
could not have, as that is not yet implemented, AFAIK.)

I would be somewhat surprised if she would not be somewhat
surprised that looking for `á' can find `a'.

Note the current discussion and the Subject line.  This
thread is about making char folding treat `á' and `a' as
equivalent, i.e., both directions.

I think it should be clear that searching for and finding
exactly what you type is _absolutely_ easier to understand
than finding things that you did not type.  Of course, both
literal and dwim searching might be easy enough in some
contexts or for some users.

So sure, this absolute difference in ease of understanding
does not preclude the existence of some users for whom even
the most complex mapping of search string to search hits
might be "easy and instantly understandable".  Such users
should not be bothered by whichever behavior is chosen as
default.

Regexp vs literal search is a good example of literal search
being easier to "get".  Regexp search requires some extra
understanding of, or feeling for, the mapping between search
patterns and what the patterns match; literal search does not:
what you type is what you find, literally.

I doubt that all newbies expect our whitespace folding or
find it natural.  Likewise, how non-nil `case-fold-search'
treats the presence of an uppercase letter in the search
string.

These things are not obvious, in general, even if you can
point to a new user for whom they seem to be obvious.  The
uppercase-letter-in-search-string behavior, in particular,
is unusual - not common in text editors.  That might have
made sense as default behavior for Emacs in 1985, but now?

These things are gotchas, even if there might be some
newbies who do not seem to have ever been "got" by them.
It is better not to make such behavior the default, as
long as the alternative is useful.

And it is easy enough to customize search to make such
dwim searching the default for any particular user.
And it is trivial to toggle the behavior anytime.
There is no special reason to make the default behavior
a "gotcha" one.

The _only argument_ that I have heard, for making folding
searches the default behavior, and the only one that I can
imagine, is that if we do not do so then users might not
discover them quickly, and so they might miss out on how
useful they can be.

I repeat what I said before about that:

  Discoverability is not an argument for choosing any
  default behavior.

  Poor discoverability is an argument for improving
  discoverability.  Nothing more.

> The key to remember here is that there are many use cases in
> which it is better if isearch finds something similar to what
> you typed than if it misses something you were looking for

No, that is not anything key to remember, in this discussion.

No one has doubted that non-literal search can be extremely
useful.  That is in fact one of the reasons for this thread:
make char-fold search do exactly that for any char in the
search string, including for a char with diacritics.
Currently, it always searches only literally for `á', even
when char folding is turned on.

It should be clear that no one is arguing against the
usefulness of folding search.  The post you responded to
was a counter to the false argument that we should turn
char folding on by default because it facilitates discovery
of this nifty feature.

This thread is not really about what the default behavior
should be, but I did address that extraneous argument,
and you did respond.  If there is a need to continue about
that topic, we should do it in a separate thread.



  reply	other threads:[~2015-09-07 17:07 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01 15:46 char equivalence classes in search - why not symmetric? Drew Adams
2015-09-01 15:52 ` Davis Herring
2015-09-01 16:51   ` Stefan Monnier
2015-09-01 17:51   ` Drew Adams
2015-09-01 18:40     ` Davis Herring
2015-09-01 19:09       ` Drew Adams
2015-09-01 22:45       ` Juri Linkov
2015-09-02  0:33         ` Drew Adams
2015-09-01 20:10     ` Stephen J. Turnbull
2015-09-01 16:16 ` Eli Zaretskii
     [not found]   ` <<38061f42-eaf1-47c6-b74d-f676ac952b18@default>
     [not found]     ` <<83r3miatvl.fsf@gnu.org>
     [not found]       ` <<21998.29683.916211.867479@a1i15.kph.uni-mainz.de>
     [not found]         ` <<9A972800-D8F0-4DA8-877E-07D5BDC2E1F9@gmail.com>
2015-09-01 17:50   ` Drew Adams
2015-09-01 18:15     ` Eli Zaretskii
2015-09-01 18:46       ` Drew Adams
2015-09-01 19:19         ` Eli Zaretskii
2015-09-01 20:15           ` Drew Adams
2015-09-08  5:36       ` Ulrich Mueller
2015-09-08  6:04         ` Jean-Christophe Helary
2015-09-08 13:31           ` Stephen J. Turnbull
2015-09-08 14:24             ` Drew Adams
2015-09-08 15:21               ` Stephen J. Turnbull
2015-09-08 16:58                 ` Drew Adams
2015-09-08 17:38                   ` Stephen J. Turnbull
2015-09-09 22:52                     ` Drew Adams
2015-09-10  3:12                       ` Drew Adams
2015-09-10 21:46                         ` Drew Adams
2015-09-08 20:15               ` Richard Stallman
2015-09-08 20:15               ` Richard Stallman
2015-09-08 21:25                 ` Drew Adams
2015-09-09 15:07                   ` Richard Stallman
2015-09-09 15:21                     ` Drew Adams
2015-09-10  2:03                       ` Richard Stallman
2015-09-10  3:23                         ` Drew Adams
2015-09-11 10:28                           ` Richard Stallman
2015-09-11 13:28                             ` Stefan Monnier
2015-09-11 16:33                               ` Drew Adams
2015-09-11 20:59                                 ` Juri Linkov
2015-09-11 23:11                                   ` Drew Adams
2015-09-12 15:28                               ` Richard Stallman
2015-09-11 16:31                             ` Drew Adams
2015-09-11 10:28                           ` Richard Stallman
2015-09-11 16:31                             ` Drew Adams
2015-09-12 15:29                               ` Richard Stallman
     [not found]             ` <<8cf269bc-69d8-4752-8506-de8d992512e1@default>
     [not found]               ` <<E1ZZPIS-0005rf-DJ@fencepost.gnu.org>
2015-09-08 21:46                 ` Drew Adams
     [not found]               ` <<E1ZZPIT-0005s6-ST@fencepost.gnu.org>
     [not found]                 ` <<da54a6cb-90eb-481d-aa20-acfad612e709@default>
     [not found]                   ` <<E1ZZgxz-0006X2-Bg@fencepost.gnu.org>
     [not found]                     ` <<cb107072-7f90-41fb-9aff-075d50eb65bb@default>
     [not found]                       ` <<E1ZZrCm-0001x4-9a@fencepost.gnu.org>
     [not found]                         ` <<4f3b1db3-d3d2-480f-8662-fbf7c74aa67f@default>
     [not found]                           ` <<E1ZaLZR-0002Bf-8q@fencepost.gnu.org>
     [not found]                             ` <<e77f8e7b-581f-436d-816a-c8daed734ff5@default>
     [not found]                               ` <<E1ZamkM-0005d4-RN@fencepost.gnu.org>
2015-09-12 15:59                                 ` Drew Adams
2015-09-08 13:39           ` Drew Adams
2015-09-08 21:19             ` Juri Linkov
2015-09-09 15:07               ` Richard Stallman
2015-09-08 15:47         ` Eli Zaretskii
2015-09-08 16:57           ` Drew Adams
2015-09-08 21:20           ` Juri Linkov
2015-09-09  2:42             ` Eli Zaretskii
2015-09-09 11:23               ` Artur Malabarba
2015-09-09 13:32                 ` Drew Adams
2015-09-09 15:12                 ` Richard Stallman
2015-09-11 20:50                   ` Juri Linkov
     [not found]               ` <<CAAdUY-JMQVsRFku8nwX8JcA9k6Y9sHWoVL6ZC60RHnjoj0cd+Q@mail.gmail.com>
     [not found]                 ` <<E1ZZh2a-0003u6-Fj@fencepost.gnu.org>
2015-09-09 15:22                   ` Drew Adams
2015-09-10  2:03                     ` Richard Stallman
2015-09-10  3:15                       ` Drew Adams
2015-09-10  6:57                         ` David Kastrup
2015-09-10 15:02                           ` Drew Adams
2015-09-10 15:50                         ` Richard Stallman
2015-09-08 20:09         ` Richard Stallman
2015-09-08 21:00           ` Drew Adams
2015-09-09 15:06             ` Richard Stallman
2015-09-08 21:47           ` Ulrich Mueller
2015-09-02 15:34   ` Richard Stallman
2015-09-02 15:56     ` Drew Adams
2015-09-02 16:05     ` Eli Zaretskii
2015-09-02 21:51       ` Jean-Christophe Helary
2015-09-02 22:15         ` Drew Adams
2015-09-03 15:37           ` Richard Stallman
2015-09-03  2:41         ` Eli Zaretskii
2015-09-03  3:08           ` Jean-Christophe Helary
2015-09-03  7:28             ` Artur Malabarba
2015-09-03 17:15               ` Drew Adams
2015-09-07 13:52                 ` Nix
2015-09-07 17:07                   ` Drew Adams [this message]
2015-09-07 23:23                     ` Nix
2015-09-08  2:17                   ` Richard Stallman
2015-09-03 14:33             ` Eli Zaretskii
2015-09-03 15:00         ` Stefan Monnier
2015-09-03 16:15           ` Drew Adams
2015-09-03 16:23             ` Eli Zaretskii
2015-09-03 16:46               ` Drew Adams
2015-09-02 16:10     ` Artur Malabarba
2015-09-03 19:49     ` Pip Cet
     [not found] <<2a7b9134-af2a-462d-af6c-d02bad60bbe8@default>

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=573d297e-730f-46b6-9290-624b9497c501@default \
    --to=drew.adams@oracle.com \
    --cc=bruce.connor.am@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=jean.christophe.helary@gmail.com \
    --cc=nix@esperi.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).