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


Message #92 received at 78719 <at> debbugs.gnu.org (full text, mbox):

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

>>>    (let* ((completion-ignore-case nil)
>>>           (completion-regexp-list regexp-list)
>>>           (prefix (try-completion "" collection)))
>>>      (if (stringp prefix)
>>>          prefix
>>>        (if (eq t prefix)
>>>            
>>>          ""))))
>
> Side note.  I recently pushed yet another bug fix where we called
> `(all/try)-completion` without binding `completion-regexp-list` and thus
> ended up inheriting that regexp constraint from the context.

Yes, a common problem.

> It's great that we can pass additional arguments via dynamic-binding,
> but in the same sense as "it's great that we can patch things with
> `advice-add`": it's better when we don't have to.

Your argument is so much between the lines that I fail to decipher it.
Which calling convention do you suggest we use?

>         Stefan




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.