Is there any way that thecompletion buffer shows every item in a single line. By default it arranges the items in several columns. (Try to do M-x f <TAB> to see what I mean).

In general what are the variables which control the appearance of this buffer?

  • There are a number of packages available that provide 'enhanced' completion which you might be interested in: oremacs.com/swiper and emacs-helm.github.io/helm are two of the more popular – Tyler Jan 31 '18 at 14:27
  • @Tyler These projects are indeed useful and practical, but keep in mind that they are not able to override the *Completions* buffer and do not always provide their own alternative to functions which use it. – Basil Feb 2 '18 at 1:00
  • @Basil You might be correct in so far as these packages don't do anything to *Completions*, but they do reduce or eliminate the situations where it shows up.I have M-x bound to counsel-M-x, and when I enter M-x f I am presented with a single column of completion candidates, as OP would like. I'm no longer bothered by the layout of *Completions*, since I don't see it. This indirectly resolves the issue, which is why I offered it as a comment and not a solution. – Tyler Feb 2 '18 at 2:21
  • 1
    @Tyler You're absolutely right - I only meant to clarify this (as you say, infrequently occurring) limitation, namely that ivy and helm are not able to intercept those few functions which don't use the common minibuffer and in-buffer completion interfaces of completing-read and completion-in-region, respectively. – Basil Feb 2 '18 at 2:25

A crude way to do that is:

(defun my-completion--insert-strings (strings)
  (dolist (string strings)
    (insert (propertize string 'mouse-face 'highlight) "\n")))
(advice-add 'completion--insert-strings
            :override #'my-completion--insert-strings)
| improve this answer | |

Vanilla Emacs offers no control over this. In general, there are no "variables which control the appearance of this buffer".

But if you use Icicles then this is easy, using option icicle-candidate-width-factor.

You can also change this on the fly anytime, during completion. (One size does not fit all when it comes to completion candidates.)

See Completions Display for more information.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.