J. Doe
J. Doe

Reputation: 41

Emacs - suppress Completion Buffer

In Emacs, I don't want the *Completions* buffer to pop up, even when I press tab to autocomplete in the minibuffer and there are multiple results. It's distracting and jarring.

How can I do this?

Even better, I would like an alternative that isn't distracting or jarring -- such as requiring one tab for autocomplete if available, but requiring two tabs to open a Completions buffer. This way, I don't get the Completions buffer when I'm expecting an autocomplete. This is what the OS X terminal does to show tab completion possibilities.

I think the cause is the minibuffer-completion-help command, which is run automatically, described here: https://www.gnu.org/software/emacs/manual/html_node/elisp/Completion-Commands.html

I use ido and smex, but the problem occurs in a vanilla Emacs too.

EDIT: I found a hack to fix this. Using M-x find-function, I found and copied the function definition of minibuffer-completion-help into my .emacs.d/init.el file. Then, I renamed the version I copied my-minibuffer-completion-help and changed (with-displayed-buffer-window *Completions* to '(with-displayed-buffer-window *Completions* (putting a quote in front so it is just interpreted as a string. Finally, I overrode the call to minibuffer-completion-help by putting

(advice-add 'minibuffer-completion-help
        :override #'my-minibuffer-completion-help)

after the my-minibuffer-completion-help function in my .emacs.d/init.el file. There must be a better way.

EDIT 2: quoting out (message "Making completion list...") in my-minibuffer-completion-help has the added benefit of getting rid of the flicker in autocomplete that is caused by flashing another message during autocomplete. Is it possible to do this another way?

Upvotes: 4

Views: 1332

Answers (2)

Stefan
Stefan

Reputation: 28601

I believe you just want to set completion-auto-help to nil:

(setq completion-auto-help nil)

Upvotes: 1

jdd
jdd

Reputation: 4336

I believe what you're looking for is either temporarily modifying display-buffer-alist, probably setting it to use display-buffer-no-window for *Completions* or M-x customize-group completion and setting Completion Show Help to nil

Upvotes: 0

Related Questions