Subject: bug#78719: 30.1; [PATCH] Add functions `string-common-prefix' and `string-try-completion'

From: Daniel Mendler <[email-masked]>
Date: Sat, 05 Jul 2025 17:28:40 +0200

Stefan Monnier <[email-masked]> writes:

>>>    (let* ((completion-ignore-case nil)
>>>           (completion-regexp-list regexp-list)
>>>           (prefix (try-completion "" collection)))
>>>      (if (stringp prefix)
>>>          prefix
>>>        (if (eq t prefix)
>>>            
>>>          ""))))
>
> Side note.  I recently pushed yet another bug fix where we called
> `(all/try)-completion` without binding `completion-regexp-list` and thus
> ended up inheriting that regexp constraint from the context.

Yes, a common problem.

> It's great that we can pass additional arguments via dynamic-binding,
> but in the same sense as "it's great that we can patch things with
> `advice-add`": it's better when we don't have to.

Your argument is so much between the lines that I fail to decipher it.
Which calling convention do you suggest we use?

>         Stefan