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:05:04 +0200

Phil Sainty <[email-masked]> writes:

> I accept that I've not swayed anyone to my viewpoint, though, so I'm
> going to remove the filter arguments and reduce the function to the
> simplest case.

Let me clarify - my viewpoint is that the following calling conventions
are acceptable:

(string-common-prefix LIST &optional IGNORE-CASE) ;; favored
(string-common-prefix LIST &optional IGNORE-CASE STRING REGEXP-LIST)
(string-common-prefix LIST &optional IGNORE-CASE REGEXP-LIST STRING)

This means I am not strongly opposed to the addition of the filter
arguments REGEXP-LIST and STRING, as long as they are given lower
priority.

I still favor (string-common-prefix LIST &optional IGNORE-CASE) since I
am not convinced that there are many call sites where the additional
arguments would be needed, and in the few cases, `try-completion' would
just do. But then I cannot say this with certainty. You've shown your
snippet and there it would be handy to have REGEXP-LIST. Also Emacs APIs
have the tendency to acquire arguments over time, so these arguments
could get added sooner or later anyway, by someone who hasn't read the
discussion, and then I don't really want to discuss this again. Also
extending APIs leads to additional effort for the Compat package, which
I maintain, so we could go directly with the four argument calling
convention.

Daniel