GNU bug report logs - #42149
Substring and flex completion ignore implicit trailing ‘any’

Previous Next

Package: emacs;

Reported by: Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>

Date: Wed, 1 Jul 2020 10:41:01 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #130 received at 42149 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 42149 <at> debbugs.gnu.org, Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>
Subject: Re: bug#42149: Substring and flex completion ignore implicit
 trailing ‘any’
Date: Mon, 28 Dec 2020 16:58:30 +0000
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> This is one of them.
>>
>>     (ert-deftest completion-pcm-test-3 ()
>>       ;; Full match!
>>       (should (eql
>>                (completion--pcm-score
>>                 (car (completion-pcm-all-completions
>>                       "R" '("R" "hello") nil 1)))
>>                1.0)))
>
> BTW, a good improvement to the tests would be to replace the score
> equality tests with score ordering comparisons (like "score of foo >
> score of bar") since it'd be perfectly OK to use a different scoring
> system which gives different values as long as the relative ordering is
> still obeyed.

I'm not so sure I agree.  I mean, I agree with the general principle,
but I also think in our particular algorithm we can make some simple
guarantees about the absolute value of the computed score in such
trivial situations.  In this case, Dario's test asserts that a full and
perfect match has a score of 1 (hundred percent).  So the test is only
brittle if we break down this pillar, and I don't think we should.  At
least I don't think we have good reason to.

João





This bug report was last modified 4 years and 43 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.