2

TL;DR: Is it possible to make emacs use single-column completion?


When using emacs' completion mechanisms and there are multiple possibilities, then completions are displayed in a separate window, e.g.

Possible completions are:
i                                  i-search
i1                                 i18n
i2                                 i3
iar                                ibm
ibm1047                            ibm1047-dos
ibm1047-mac                        ibm1047-unix
ibm437                             ibm437-dos
ibm437-mac                         ibm437-unix
ibm775                             ibm775-dos
ibm775-mac                         ibm775-unix
ibm850                             ibm850-dos
ibm850-mac                         ibm850-unix
ibm851                             ibm851-dos
ibm851-mac                         ibm851-unix
ibm852                             ibm852-dos
ibm852-mac                         ibm852-unix
ibm855                             ibm855-dos
ibm855-mac                         ibm855-unix
ibm857                             ibm857-dos

While this format is perfectly fine for a few items, when the list is long having successive completions on the same line, i.e. ordered as

1    2
3    4
5    6

is rather distracting. Ideally I'd prefer an ordering

1    4
2    5
3    6

but I fear this is not possible, since it wouldn't be able to handle completions, that are wider than each column. Emacs in this case uses a format

111  222
33333333
444  5555

which works only because of the "horizontal first" ordering; Also my preferred ordering would require adjustig the completion-buffer contents depending on window height (likewise unpracticable).

So as an alternative I'd like completion to use only one column, i.e.

Possible completions are:
i                                  
i-search
i1                                 
i18n
i2                                 
i3
iar                                
ibm
ibm1047                            
ibm1047-dos
ibm1047-mac                        
ibm1047-unix
ibm437                             
ibm437-dos
ibm437-mac                         
ibm437-unix

which I'd find easier to scan visually.

Is this possible?

1
1

Maybe you want to change completions-format?

It doesn't restrict the output to a single column, tho. It would be easy to add that functionality to completion--insert-strings (which is the function that inserts the completions in that buffer), so maybe you should request that as a new feature.

0

If you use Icicles then just customize user option icicle-Completions-max-columns to the value 1.

If you don't want a single column always, you can change the *Completions* display on the fly incrementally, changing the space between candidates or the number of columns to use.

0

Suggest to have a look at this: https://github.com/oantolin/live-completions

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.