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: Eli Zaretskii <eliz <at> gnu.org>
To: Phil Sainty <psainty <at> orcon.net.nz>
Cc: mail <at> daniel-mendler.de, 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: Tue, 10 Jun 2025 18:32:03 +0300
> Date: Wed, 11 Jun 2025 01:51:29 +1200
> From: Phil Sainty <psainty <at> orcon.net.nz>
> Cc: Daniel Mendler <mail <at> daniel-mendler.de>, 78719 <at> debbugs.gnu.org,
>  eliz <at> gnu.org, drew.adams <at> oracle.com, juri <at> linkov.net
> 
> 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.




This bug report was last modified 4 days ago.

Previous Next


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