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

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

bug#67210: 30.0.50; completing-read with REQUIRE-MATCH=t can sometimes r


From: Stefan Monnier
Subject: bug#67210: 30.0.50; completing-read with REQUIRE-MATCH=t can sometimes return a non-match
Date: Fri, 17 Nov 2023 11:06:09 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>  (defun completion-emacs22-try-completion (string table pred point)
>    (let ((suffix (substring string point))
>          (completion (try-completion (substring string 0 point) table pred)))
> -    (if (not (stringp completion))
> -        completion
> +    (cond
> +     ((eq completion t)
> +      ;; The prefix is an exact and unique completion, but STRING
> +      ;; might not be a completion.
> +      (if (test-completion string table)
> +          t
> +        (cons string point)))

I think we should test (equal "" suffix) instead.
The cases where (equal "" suffix) is false but (test-completion string table)
are sufficiently weird that returning t seems risky and I can't think of
any reason why it's worthwhile to take this risk.


        Stefan






reply via email to

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