Subject: bug#65348: INITIAL-INPUT in completing-read repeats same entry twice consecutively

From: Heime <[email-masked]>
Date: Thu, 17 Aug 2023 10:27:27 +0000

Sent with Proton Mail secure email.

------- Original Message -------
On Thursday, August 17th, 2023 at 7:20 PM, Eli Zaretskii <[email-masked]> wrote:

> > Date: Thu, 17 Aug 2023 06:05:06 +0000
> > From: Heime [email-masked]
> > Cc: [email-masked]
> > 
> > > Sorry, I don't understand what you are saying. What do you mean by
> > > "is displayed twice consecutively"? I guess some details are missing
> > > from your report to make it complete and self-explanatory?
> > 
> > Consider the function defined by
> > 
> > (defun bigops (grafm seltr)
> > (interactive
> > (let ( (collecj '("boxplus" "boxtimes" "Cap" "centerdot" "circledast")) )
> > (completing-read "Grapheme: " collecj nil t "boxplus")))
> > 
> > The user would see "boxplus", then the following element shows "boxplus"
> > consecutively again. Could you consider the capability that when one uses
> > REQUIRE-MATCH, the function finds the entry for INITIAL-INPUT so that the
> > next thing that gets shown after that starts from the one following the
> > match in COLLECTION. Otherwise, one is forced to put the INITIAL-INPUT
> > entry at the end of COLLECTION.
> 
> 
> Sorry, I still don't understand: what are "the following element" and
> "the next thing that gets shown"? Shown how? What causes them to be
> shown?

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.