Subject: Re: bug#39484: 26.3; try-completion bug

From: Wanrong Lin <[email-masked]>
Date: Tue, 27 Oct 2020 20:57:30 -0400

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