GNU bug report logs - #65459
completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH

Previous Next

Package: emacs;

Reported by: Heime <heimeborgia <at> protonmail.com>

Date: Tue, 22 Aug 2023 22:05:02 UTC

Severity: normal

Full log


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

From: Juri Linkov <juri <at> linkov.net>
To: Heime <heimeborgia <at> protonmail.com>
Cc: Gregory Heytings <gregory <at> heytings.org>, 65459 <at> debbugs.gnu.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION
 and REQUIRE-MATCH
Date: Fri, 25 Aug 2023 09:59:56 +0300
>> Heime, can you try that and tell us if it solves your problem?
>
> The behaviour is as it should be.  Although we should keep 'start' to correspond to
> collection index which customarily starts from value 0.
>
> Although I can use the function provided, I rather have all this incorporated in
> 'completing-read'.  Because 'completing-read' would benefit from it.  Particularly
> now that its use is being extended.  This taking into account that my use case
> is more aligned with its original operation, except that certain aspects which I have
> shown to be important were not recognised at the time.  After some focused attention,
> Stefan concurred how I have been making sense, particularly after seeing how `completing-read`
> actually behaves during the form of cycling I discussed at some length.

Why couldn't you explicitly provide a list of default values
without the initial value?  This solves your problem:

  (let ((cseq '("alpha" "beta" "gamma" "delta" "epsilon" "zeta" "eta")))
    (completing-read "Grapheme: " cseq nil t "alpha" nil (cdr cseq)))

PS: Currently this can't be done automatically because 'completing-read-default'
doesn't set a buffer-local 'minibuffer-initial-input' from its argument
'initial-input'.




This bug report was last modified 1 year and 289 days ago.

Previous Next


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