GNU bug report logs - #78719
30.1; [PATCH] Add functions `string-common-prefix' and `string-try-completion'

Previous Next

Package: emacs;

Reported by: Phil Sainty <psainty <at> orcon.net.nz>

Date: Sun, 8 Jun 2025 12:05:01 UTC

Severity: normal

Tags: patch

Found in version 30.1

Full log


View this message in rfc822 format

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: Phil Sainty <psainty <at> orcon.net.nz>
Cc: Eli Zaretskii <eliz <at> gnu.org>, juri <at> linkov.net, monnier <at> iro.umontreal.ca, drew.adams <at> oracle.com, 78719 <at> debbugs.gnu.org
Subject: bug#78719: 30.1; [PATCH] Add functions `string-common-prefix' and `string-try-completion'
Date: Sat, 05 Jul 2025 17:05:04 +0200
Phil Sainty <psainty <at> orcon.net.nz> 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




This bug report was last modified 57 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.