bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#39484: 26.3; try-completion bug


From: Wanrong Lin
Subject: bug#39484: 26.3; try-completion bug
Date: Tue, 27 Oct 2020 20:57:30 -0400
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1

I just tried this in Emacs 26.3:

(let ((completion-ignore-case t))
  (try-completion "abc" '("Abcde" "aBcdf" "abCdg"))) -> "Abcd"

The answer is not bad, matching at least one of the candidates. That makes the answer to my original example even more odd:
(let ((completion-ignore-case t))
       (try-completion "xyz" '("XyzD" "XyzAbc"))
       )
==> "xyz"

Why does it matter whether any additional chars follow the user input in the match?

Wanrong

On 10/27/2020 8:47 PM, Wanrong Lin wrote:
Sorry, I meant "abcd" as the answer for your example.

On 10/27/2020 8:44 PM, Wanrong Lin wrote:
For this case, "abc" might be OK, unless you think there is another better answer. But in the example I gave, don't you think "Xyz" is obviously a better answer than "xyz"?

The argument here is for some examples, the function does not return the best answer, and also, does not seem to be consistent to me (for those two examples I gave). There might be a reason behind this "compromise", or, it might be just an arbitrary decision as documented in the comments you gave. If it is the latter, can we improve on it? I think those are valid questions.

Wanrong

On 10/27/2020 5:21 PM, Andreas Schwab wrote:
So what should (try-completion "abc" '("Abcde" "aBcdf" "abCdg")) return?

Andreas.









reply via email to

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