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 #89 received at 78719 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Phil Sainty <psainty <at> orcon.net.nz>, mail <at> daniel-mendler.de,
 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 11:26:15 -0400
>>    (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.

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.


        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.