From: Drew Adams <drew.adams@oracle.com>
To: John Wiegley <johnw@gnu.org>
Cc: 22494@debbugs.gnu.org, mbork@mbork.pl, rms@gnu.org, jidanni@jidanni.org
Subject: bug#22494: still can't search for two spaces
Date: Wed, 3 Feb 2016 06:57:44 -0800 (PST) [thread overview]
Message-ID: <450ada88-ae30-4cde-8db0-cc8e625eebf9@default> (raw)
In-Reply-To: <m2bn7ymgve.fsf@newartisans.com>
> > Heeding what is in the search string means nothing - or anything.
>
> I don't know why you're saying this Drew.
By itself, it could mean anything. What does it mean to "heed"
the current search pattern? Nothing implies that a single
whitespace char in a row should mean that "heed" means switch
to lax whitespace matching.
The whole question about what kind of matching to do (lax, literal,
regexp,...) is about the meaning of "heeding" the search pattern
in a given context.
> If the user types something into the search string, and exactly that
> something is present in the buffer, Emacs should locate it before any
> "lax" variant.
Really? Always? I wouldn't have a problem with that (except if
you mean for it to apply also to regexp search). But those who
are fans of lax whitespace search might not like it.
Today, not only is lax whitespace matching a possibility, but it
is the default for C-s. What you suggest would mean that even
with lax w-s matching, search should first look for an exact
match, before finding a lax match (i.e., even if that lax match
came before the literal match).
> This means that type "nD" where nD exists, should find nD. Typing
> " " where two spaces exist, should find the two spaces.
I have no problem with that, and have said so multiple times now.
I was the first to +1 the motion that multiple, contiguous whitespace
chars should automatically turn off lax-ws matching.
> Whether or not lax whitespace matching should be the default is an entirely
> separate matter. I rather like the lax matching, so long as my use of two
> spaces in a search string does not mean that I can't find two spaces.
Yes, the default behavior is a different matter from whether the
matching mode should switch automatically depending on the search
string.
I think perhaps you misread what I've written. I simply pointed
out that, while I agree with the proposal to automatically turn
off lax w-s if you type multiple w-s chars, there are some possible
questions for what to do in these cases:
a. You delete the multiple w-s chars, so there is now only one
in a row. Should we then turn lax w-s matching back on?
I only raised the question - I didn't propose an answer.
b. Instead of _typing_ multiple, contiguous w-s chars (which
some of us have agreed should turn off lax w-s), you _paste_
text that includes multiple, contiguous w-s chars. Should
we turn off lax w-s in that case too? Again, I only raised
the question - I didn't propose an answer.
In some cases where you paste such text, you might be well
aware that there are multiple such chars in a row, and you
might purposefully want to search for them literally.
This can be the case if you copy and yank code, for example.
And it is more likely to be true if you copy+paste text
from an Emacs buffer than non-code text from outside Emacs.
In other cases, you might not realize that there are
multiple such chars in a row, and you might not really
care to search literally. This can happen if you paste
text copied from outside Emacs, for instance.
In sum:
1. I agree (!) with the proposal to automatically turn OFF
lax w-s search if you type multiple, contiguous w-s chars.
2. I proposed that when that happens we clearly indicate the
change to users.
3. I raised a question about whether lax w-s matching should
be automatically turned back ON if you change the search
string (e.g. delete some chars) so that it no longer has
multiple, contiguous w-s chars.
4. I raised a question about whether lax w-s matching should
be automatically turned OFF if you _paste_ (not type) text
that contains multiple, contiguous w-s chars.
TL;DR:
DWIM is hard. It never does what everyone means, in every
context. It's about compromises & judgment. And it requires
good feedback about what it's doing for "free". DWIM behind
a user's back always bites someone, in the end. ;-)
Hope this clears things up a bit.
next prev parent reply other threads:[~2016-02-03 14:57 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <<<87h9hvshi3.fsf@jidanni.org>
[not found] ` <<<E1aPdiw-0001yi-W4@fencepost.gnu.org>
[not found] ` <<54a07b7d-1fbd-4ed1-a8a0-e22eb5787c97@default>
[not found] ` <<871t8yit11.fsf@mbork.pl>
[not found] ` <<77b5b6df-4889-4142-a04d-526dd94c3a48@default>
[not found] ` <<E1aPyeg-0003QJ-B5@fencepost.gnu.org>
2016-01-31 21:29 ` bug#22494: still can't search for two spaces Drew Adams
2016-02-01 11:01 ` Richard Stallman
2016-02-01 11:20 ` Andreas Schwab
2016-02-01 14:15 ` Dani Moncayo
2016-02-03 6:45 ` John Wiegley
2016-02-03 14:57 ` Drew Adams [this message]
2016-02-03 18:56 ` John Wiegley
2016-02-03 19:08 ` Drew Adams
2016-02-03 15:28 ` Eli Zaretskii
2016-02-03 15:44 ` Nicolas Richard
[not found] <<87h9hvshi3.fsf@jidanni.org>
[not found] ` <<8337tfy0p3.fsf@gnu.org>
[not found] ` <<E1aPdiw-0001yi-W4@fencepost.gnu.org>
2016-01-30 22:28 ` Drew Adams
2016-01-30 22:47 ` Marcin Borkowski
2016-01-31 0:02 ` Drew Adams
2016-01-31 20:31 ` Richard Stallman
2016-01-31 0:08 ` Juri Linkov
2016-01-30 6:34 積丹尼 Dan Jacobson
2016-01-30 7:40 ` Eli Zaretskii
2016-01-30 22:10 ` Richard Stallman
2016-01-31 5:39 ` John Wiegley
2016-01-31 16:08 ` Drew Adams
2016-02-01 0:13 ` 積丹尼 Dan Jacobson
2016-02-01 1:57 ` Drew Adams
2016-02-01 3:10 ` 積丹尼 Dan Jacobson
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=450ada88-ae30-4cde-8db0-cc8e625eebf9@default \
--to=drew.adams@oracle.com \
--cc=22494@debbugs.gnu.org \
--cc=jidanni@jidanni.org \
--cc=johnw@gnu.org \
--cc=mbork@mbork.pl \
--cc=rms@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.