GNU bug report logs - #65348
INITIAL-INPUT in completing-read repeats same entry twice consecutively

Previous Next

Package: emacs;

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

Date: Thu, 17 Aug 2023 00:48:01 UTC

Severity: normal

Tags: notabug

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Heime <heimeborgia <at> protonmail.com>
Cc: 65348 <at> debbugs.gnu.org
Subject: Re: bug#65348: INITIAL-INPUT in completing-read repeats same entry
 twice consecutively
Date: Thu, 17 Aug 2023 13:45:27 +0300
tags 65348 notabug
close 65348
thanks

> Date: Thu, 17 Aug 2023 10:27:27 +0000
> From: Heime <heimeborgia <at> protonmail.com>
> Cc: 65348 <at> debbugs.gnu.org
> 
> The collection COLLECJ is this ordered sequence 
> 
> "boxplus" "boxtimes" "Cap" "centerdot" "circledast"
> 
> with the call to COMPLETING-READ being
> 
> (completing-read "PROMPT: " collecj nil t "boxplus")))
> 
> Where REQUIRE-MATCH is t
> 
> and INITIAL-INPUT is "boxplus"
> 
> Now, the user gets the prompt with "boxplus" displayed.
> 
> The user moves to the next completion candidate, which is also "boxplus",
> the entry at the beginning of COLLECTION.

Which is why the ELisp manual says:

     The argument INITIAL is mostly deprecated; we recommend using a
     non-‘nil’ value only in conjunction with specifying a cons cell for
     HISTORY.  *Note Initial Input::.  For default input, use DEFAULT
     instead.

In any case, the fact that you see "boxplus" as the first suggestion
of the "future history" is because you both added it to COLLECTION and
set INITIAL to it.  So showing it as the first suggestion is exactly
what completing-read should do in this case.

This is not a bug, and so I'm closing it.




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

Previous Next


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