Is there a simple way to make it so that the *Completions* buffer that pops up when, say, tab completing on a find-file doesn't create a new buffer but shows the possible completions in the minibuffer? I've spent quite a bit of time trying to figure out how to do this, but am finding it a lot harder than I expected.
3 Answers
If ido doesn't do what you want, maybe also have a look at ivy. It will display completions in the minibuffer. By default, it will make the minibuffer 10 lines tall during completion, which is enough to see the most relevant completion candidates without taking over your frame too much. When this completion list is displayed, you can browse it with C-n and C-p (or up and down arrow keys) to highlight the completion candidate you want. As soon as you accept a completion, the minibuffer will shrink back to its normal size.
As mentioned by Drew, icomplete-mode would be the most obvious answer. From a subsequent comment you seem to say that it doesn't cut it, but it's not clear why.
In ido, you can set ido-decorations such that every candidate is listed on a separate line, and it shouldn't be too difficult to change icomplete-mode to do the same.
Would that satisfy your needs? It still would be pretty far from the functionality of *Completions*, since it still wouldn't let you click on a completion to choose one, not scroll the completions or search them with C-s, ...
Then again, what part of "in the minibuffer" matters to you? After all, in many cases the only difference is the presence of a modeline between the completions and the text you're typing.
In emacs 30, icomplete-vertical-mode provides something like that.
here's my configuration:
(use-package icomplete :demand t :custom ;; For info: C-h v completion-styles-alist (completion-styles '(flex partial-completion substring)) ;; flex initials basic (completion-category-overrides '((buffer (styles initials flex) (cycle . 10)) ;; C-h v completion-cycle-threshold (file (styles basic substring) (cycle . 10)) (symbol-help (styles basic shorthand substring)))) (read-file-name-completion-ignore-case t) (read-buffer-completion-ignore-case t) (completion-ignore-case t) (max-mini-window-height 0.2) (icomplete-prospects-height 15) (icomplete-show-matches-on-no-input t) :config (icomplete-mode) (icomplete-vertical-mode) :bind (:map icomplete-vertical-mode-minibuffer-map ;; icomplete-minibuffer-map <== for the non-vertical version ("TAB" . icomplete-force-complete) ("RET" . icomplete-force-complete-and-exit) ("C-c C-j" . exit-minibuffer) ;; exit without completion ("C-v" . icomplete-vertical-mode) ;; toggle ) ) 
idothat creates the possibility for both -- i.e., see completions in the minibuffer usingido(a rotating single line of possibilities to scroll through, that narrows options as a user types), and the tab key pops upen the*Completions*buffer if so desired.icomplete-modeandido-modeprovide. Both come standard with Emacs.*Completions*buffer, as-is, to instead be a minibuffer, not a rotating single line or a modified version whichicomplete-modeandido-modeprovide.minibuffer.eland saw enough to make me believe that this probably cannot be answered within the scope of what generally fits into answers on this forum. It looks to me like this feature request would be a new library that is a modification of the aforementioned. That's not to say that it wouldn't be a nifty feature, it's just too time consuming and lengthy for someone to take the time to write-up unless its something they want to use themselves on a regular basis or they have lots of free time on their hands. It would exceed the character limit.