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

From: Eli Zaretskii <[email-masked]>
Date: Tue, 10 Jun 2025 18:32:03 +0300

> Date: Wed, 11 Jun 2025 01:51:29 +1200
> From: Phil Sainty <[email-masked]>
> Cc: Daniel Mendler <[email-masked]>, [email-masked],
>  [email-masked], [email-masked], [email-masked]
> 
> On 2025-06-11 00:15, Eli Zaretskii wrote:
> > Why do we need cl-defun here, anyway?  How many arguments should these
> > functions have?
> 
> There's one mandatory argument and four optional ones which
> can be mixed and matched without any obvious priority sequence.
> Daniel had used cl-defun when he suggested merging my original
> two functions into one, and I thought that the use of keyword
> args did seem like a nicer API than a regular function.
> 
> It could be a regular function, though; I don't think there
> was anything *precluding* that.  I'd probably go with this
> argument order if we do that:

Then let's have a regular function.  5 arguments is not too much, IMO.

> (string-common-prefix COLLECTION &optional IGNORE-CASE STRING 
> REGEXP-LIST PREDICATE)

I think STRING should come before IGNORE-CASE.  Otherwise, LGTM,
thanks.