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:29:12 +0200
Phil Sainty <psainty <at> orcon.net.nz> writes:

> On 2025-07-06 02:38, Daniel Mendler wrote:
>> A non-nil STRING is a special case, an optimization, which is also
>> covered by REGEXP-LIST by using a regexp with an anchor. It should
>> not come before IGNORE-CASE.
>
> That was also my initial preference for the argument sequence so that
> the filters were all together as a logical group, but Eli felt that it
> was more useful to have STRING before IGNORE-CASE, so I wrote the code
> with it that way around, and only grouped the filters in the docs.

Then we can maybe convince Eli that the following calling convention is
better, since the filtering arguments STRING and REGEXP-LIST are
deprioritized? The STRING and REGEXP-LIST arguments are
completion-related, while IGNORE-CASE is needed for basic
case-insensitive prefix computation.

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

Alternatively we could go with the simplest form and suggest to use
`try-completion' if additional filtering is needed.

(string-common-prefix LIST &optional IGNORE-CASE)

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.