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

From: Keith David Bershatsky <[email-masked]>
Date: Mon, 17 Mar 2025 13:20:15 -0700

Ah ... yes, enabling ido-mode would also do the trick.  I saw that ido-completing-read calls ido-common-initialization before calling ido-read-internal, and that is why I concluded that ido-common-initialization should likewise precede ido-read-internal inside ido-read-buffer.  I use ido-completing-read quite a bit, but do not enable ido-mode.

Perhaps once upon a time someone somewhere tried to use ido-completing-read without enabling ido-mode, and he/she decided to add ido-common-initialization before ido-read-internal.  E.g., the usage of gnus-ido-completing-read without turning on ido-mode.

As to part 2 of 2, I cannot explain the difference in behavior.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

> Date: [03-17-2025 12:25:22] <17 Mar 2025 21:25:22 +0200>
> From: Eli Zaretskii <[email-masked]>
> To: Keith David Bershatsky <[email-masked]>
> Cc: [email-masked]
> Subject: Re: bug#77063: 29.1; ido-read-buffer
> 
> > Date:  Mon, 17 Mar 2025 09:50:37 -0700
> > From:  Keith David Bershatsky <[email-masked]>
> > Cc:  [email-masked]
> >
> > As to part 1 of 2, the goal is to be able to start Emacs 30.1, (require 'ido), evaluate (ido-read-buffer ...) and be greeted with a prompt displaying the ido rotating choices that looks like this:
> >
> > PROMPT:  {*scratch* | *Messages* | *GNU Emacs*}
> >
> > Starting from Emacs 30.1 without any user configuration, if we only evaluate (require 'ido) and then evaluate (ido-read-buffer ....), we do _not_ see any choices following the prompt.  This is because there needs to be call to ido-common-initialization _before_ calling ido-read-internal within ido-read-buffer.  Once ido-common-initialization has been run one time, all subsequent calls to ido-read-buffer work as expected.
> 
> Aren't you supposed to turn on ido-mode?  Just loading ido.el doesn't
> have to be enough to activate the mode.
> 
> > As to part 2 of 2, we just press the TAB key after evaluating (ido-read-buffer ...), and C-x o a couple of times to place focus in the choices buffer and select the *Messages* buffer.  Once the *Messages* buffer has been selected and inserted into the minibuffer, we press the RET key and exit ido-read-buffer.  The result that is thrown is *scratch*, which we did not expect.
> 
> That's what I did, and the result was *Messages*.