unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Stefan Monnier'" <monnier@iro.umontreal.ca>
Cc: bug-gnu-emacs@gnu.org, 4708@emacsbugs.donarmstrong.com
Subject: bug#4708: 23.1; completion-try-completion adds an extra $:  $$HOMj
Date: Tue, 13 Oct 2009 20:36:08 -0700	[thread overview]
Message-ID: <1BA03741DA0342379EBFBADC279839F8@us.oracle.com> (raw)
In-Reply-To: <jwvaazu7man.fsf-monnier+emacsbugreports@gnu.org>

> That try-completion will return nil when applied to "/foo/bar/$$HOMj",
> so basically the $HOMj -> $$HOMj is considered to be a form 
> of completion.

Sorry, I don't follow that. Could you say it differently? And did you mean
try-completion or completion-try-completion? Sorry, I don't know what you mean
here.

> That decision is taken by read-file-name-internal.  Can you try the
> patch below to see if it improves the behavior?

Yes, it seems to fix the problem. Thanks.

> Note that a completion table might very well allow completion 
> from /u to /usr/ even if none of the files in /usr/ are
> acceptable completion candidates.  I.e. try-completion may
> sometimes return a string even if there is no real valid
> completion with that prefix.  This is simply because it may
> be too costly for the function to verify it (e.g. having
> to traverse the whole /usr/ subtree).

I understand.

The problem is not so much what is done and the given trade-offs chosen for a
case like that. The problem is to keep users in control - at the very least
giving them knowledge of what the story is. If the command in question tells
users just what you said, then they can know what to expect and can act en
connaissance de cause.

What's not good is to surprise users or keep them guessing about what's
happening and why. This is a problem with DWIM generally. It's no big deal for
something inconsequential, but it can matter where user actions depend on the
result.

Users need to have a reasonable mental model of the behavior (which need not
reflect how things are actually implemented, of course).

Part of helping them in this respect is providing feedback. I've said before
that partial completion can be surprising and confusing - that's nothing new.
But what's worse is that we slip silently from one kind of completion attempt to
another, and another.

We don't say, "No prefix completions found. Do you want to try now for partial
completions?". After running down an unknown number of completion methods under
the covers, we don't even let the user know at the end which method was
ultimately successful.

The user has no way of knowing what kind of completion was actually used, which
means no good way of determining how the result relates to his input.

This can make him lose confidence in his mental model, his general understanding
of the program, and ultimately himself. We should be empowering users, not
making them feel like they're not in control or have no idea what's going on.

Sure, sometimes it doesn't really matter. You don't need to know the details
about how Google finds what it finds - as long as the results seem sensible to
you most of the time. I believe that with the latest completion enhancements
Emacs users are too often confused and surprised, and that we could do a better
job of helping them understand - at least what happened and why.

Anyway, this bug seems to have been fixed - thx.






  reply	other threads:[~2009-10-14  3:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <jwvhbu262yq.fsf-monnier+emacsbugreports@gnu.org>
2009-10-12 19:05 ` bug#4708: 23.1; completion-try-completion adds an extra $: $$HOMj Drew Adams
2009-10-13 20:13   ` Stefan Monnier
2009-10-13 22:20     ` Drew Adams
2009-10-14  2:40       ` Stefan Monnier
2009-10-14  3:36         ` Drew Adams [this message]
2009-10-14  4:10   ` bug#4708: marked as done (23.1; completion-try-completion adds an extra $: $$HOMj) Emacs bug Tracking System

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=1BA03741DA0342379EBFBADC279839F8@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=4708@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).