I want to do a completing read with the *Completions*
buffer already shown (because I'm providing initial input that I already know is an ambiguous prefix). How can I do it?
I don't see an option for this in completing-read
. I want a method that works in both Emacs 23 (where completing-read
is defined in C) and in Emacs 24 (where completing-read
relays to the function indicated by the variable completing-read-function
, so I suppose I could just change that) — of course a solution based on (if (boundp 'completing-read-function))
is fine.
Although my immediate use case is with a known ambiguous initial input, something that works regardless of that would be nice. Also, if the user has overridden the default read mechanism (e.g. by redefining completing-read
to invoke ido-completing-read
or anything-completing-read
or by turning on Icicles or Helm), I'd like my code to achieve the same effect, i.e. start the completion mechanism with the list of completions already shown.
all-completions
anddisplay-completion-list
? In what way does that not do what you want? 3. So far, your question remains not very clear, at least to me.(defalias 'completing-read 'ido-completing-read)
, I want my code to work reasonably. 2.all-completions
anddisplay-completion-list
are just some of the building bricks: I'd need to write (copy?) more code to create and display the completions buffer. 3. I've edited the bit that bothers you in my question. I've also posted an answer which does what I want inemacs -q
but isn't robust to user customizations.icicle-show-completions-initially-flag
around your call tocompleting-read
. The behavior in both cases is the same. – Drew Dec 29 '14 at 01:18