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

From: Daniel Mendler <[email-masked]>
Date: Sun, 08 Jun 2025 16:34:30 +0200

Phil Sainty <[email-masked]> writes:

> On 2025-06-09 00:21, Daniel Mendler wrote:
>> What is the purpose of having a separate function
>> `string-try-completion'?
>
> The purpose was just to keep `string-common-prefix' as simple as
> possible without people then needing to go back to `try-completion'
> if they wanted the more complicated features.

Okay, but for more features people can always fall back to
`try-completion'. What I find problematic are the dynamic variables
`completion-regexp-list' and `completion-ignore-case'. They should
rather be passed as arguments, such that the function is self-contained
and decoupled from the completion variables.

>> (cl-defun string-common-prefix (strings &key prefix ignore-case
>> regexps predicate))
>
> Yes, offhand that seems fine as well.
>
> I don't think I have a preference.

If this works for you, I think it is better to go with a single function
instead of adding multiple new variants of rarely used functions.

> -Phil