Subject: bug#77063: 29.1; ido-read-buffer

From: Eli Zaretskii <[email-masked]>
Date: Mon, 17 Mar 2025 18:33:35 +0200

> Date:  Mon, 17 Mar 2025 08:16:31 -0700
> From:  Keith David Bershatsky <[email-masked]>
> Cc:  [email-masked]
> 
> Thank you, Eli, for looking into this particular bug report.  I just installed Emacs 30.1 on Debian 8.11 (Jessie) and was able to repeat the steps to reproduce the reported behavior.  Attached hereto are four (4) screenshots depicting both of the issues reported:
> 
> SCREENSHOT:  001__part_1_of_2__step_2.png
> 
> This screenshot depicts the minibuffer PROMPT _without_ any ido completion choices.
> 
> PROMPT:  [no ido choices]
> 
> In order to display ido completion choices following the PROMPT, it is necessary to first run (ido-common-initialization).  Once that is done, repeating Step 2 yields the expected result:
> 
> PROMPT:  {*scratch* | *Messages* | *GNU Emacs*}
> 
> SCREENSHOT:  002__part_2_of_2__step_4__select_messages_buffer.png
> 
> After pressing the tab key, navigate to the ido choices buffer and select the *Messages* buffer.
> 
> SCREENSHOT:  002__part_2_of_2__step_4__messages_buffer_selected.png
> 
> We have chosen the *Messages* buffer from the ido choices buffer, and inserted that choice into the minibuffer -- following the PROMPT:.
> 
> SCREENSHOT:  002__part_2_of_2__step_4__returns_scratch_buffer.png
> 
> We pressed the enter button to select the *Messages* buffer and exit the ido-read-buffer function.  The erroneous result returned is the *scratch* buffer.
> 
> One idea to fix the first issue is to add (ido-common-initialization) inside ido-read-buffer:
> 
> (defun ido-read-buffer (prompt &optional default require-match predicate)
>   "..."
>   (let* (...
>          (buf (progn (ido-common-initialization)
>                      (ido-read-internal 'buffer prompt 'ido-buffer-history default require-match))))
>     ...
> 
> I do not have a solution for the second problem described in part 2 of 2.

Thanks, but the screenshots don't help.  I need a way to reproduce
this behavior.  Maybe your recipe was not detailed enough?