unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Wanrong Lin <wrglin@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Lars Ingebrigtsen <larsi@gnus.org>,
	Andreas Schwab <schwab@linux-m68k.org>,
	39484@debbugs.gnu.org
Subject: bug#39484: 26.3; try-completion bug
Date: Wed, 28 Oct 2020 11:47:34 -0400	[thread overview]
Message-ID: <962e72d1-451f-7725-a22c-e35b4a5784b1@gmail.com> (raw)
In-Reply-To: <jwvo8kmh18t.fsf-monnier+emacs@gnu.org>


The examples I gave are real life situations. I discovered this issue 
from an unexpected behavior with ido. The "bug" has real negative 
consequences, at least for me.

As for this:

"It does it by refraining from mix-and-match:
either the whole result comes from the user input or the whole result
comes from *one* of the candidates."

It still sounds quite arbitrary to me, as I failed to understand why it 
is bad if the whole result comes from *all* of the candidates if that 
happens to be possible.

I will try to give a version which I think is better (up to debate, of 
course)

For the user input x, return a string y (or nil if impossible) so that 
it satisfies all three conditions below:

1. x is a prefix of y, ignoring case.

2. y is the maximum common prefix, ignoring case, among all candidates

3. y is the *exact* (including case) prefix of at least one of the 
candidates

Wanrong

On 10/28/2020 10:45 AM, Stefan Monnier wrote:
>> 1. Return value is not ideal. You can argue it is still not wrong, but
>>     I think we can improve.
> Indeed, it can be improved, but we should not try to be too clever about
> it, because some choices might seem obvious in some circumstances but
> would result in rather poor answers in other cases.
>
> So rather than hypothetical cases like what we've seen here, I'm much
> more interested in real life situations.
>
> The current design is trying to be conservative, in the sense that it
> tries to avoid returning a poor result, at the cost of sometimes failing
> to return a better result.  It does it by refraining from mix-and-match:
> either the whole result comes from the user input or the whole result
> comes from *one* of the candidates.
>
> There are cases where `completion-try-completion` (as opposed to
> `try-completion`) doesn't actually follow this rule correctly, and it's
> been a source of suboptimal results.
>
>
>          Stefan
>






  reply	other threads:[~2020-10-28 15:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07 15:44 bug#39484: 26.3; try-completion bug Wanrong Lin
2020-10-27 18:42 ` Lars Ingebrigtsen
2020-10-27 19:08   ` Andreas Schwab
2020-10-27 19:17     ` Lars Ingebrigtsen
2020-10-27 20:17       ` Wanrong Lin
2020-10-27 20:28         ` Andreas Schwab
2020-10-27 20:44           ` Wanrong Lin
2020-10-27 21:21             ` Andreas Schwab
2020-10-28  0:44               ` Wanrong Lin
2020-10-28  0:47                 ` Wanrong Lin
2020-10-28  0:57                   ` Wanrong Lin
2020-10-28  7:51                     ` Andreas Schwab
2020-10-28  9:35                       ` Lars Ingebrigtsen
2020-10-28  9:42                         ` Andreas Schwab
2020-10-28  9:50                           ` Lars Ingebrigtsen
2020-10-28  9:56                             ` Andreas Schwab
2020-10-28 11:16                               ` Lars Ingebrigtsen
2020-10-28 11:44                                 ` Andreas Schwab
2020-10-28 12:59                                   ` Wanrong Lin
2020-10-28 14:45                                     ` Stefan Monnier
2020-10-28 15:47                                       ` Wanrong Lin [this message]
2020-10-28 16:34                                         ` Stefan Monnier
2022-04-23 13:17                                       ` Lars Ingebrigtsen

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=962e72d1-451f-7725-a22c-e35b4a5784b1@gmail.com \
    --to=wrglin@gmail.com \
    --cc=39484@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=schwab@linux-m68k.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 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).