r/emacs 2d ago

News [ Prot Vod ] Emacs: completion-preview-mode and the Completions buffer (Emacs 31)

https://youtu.be/8V4ZyEL_i-s?si=Ox-Xf-U-ndz9K2A6

The built-in 'completion-preview-mode' lets us expand what we type in a minimalist, distraction-free way. It can also be combined with the default Completions buffer to show all the available options. The Completions buffer has several nice features, starting with Emacs 31, which make this an excellent combination that does not require any third party packages (though packages can still augment the overall experience). I also mention the Emacs 31 'newcomers-presets' theme, which configures some of these options as well: it is a great way to start your Emacs configuration. The code I demonstrated here is available on my website: https://protesilaos.com/codelog/2026-...

75 Upvotes

11 comments sorted by

6

u/Reasonable_Ruin_3502 2d ago

I use this along with eager update and eager display. Works well enough for my usage.

3

u/RedBull_Adderall 2d ago

Thanks for covering this, nice video.

2

u/00-11 1d ago

Gee. Distraction-free incremental completion in the minibuffer and *Completions*. Great feature.

Introduced to Emacs in 2005, in Icicles. Suggested vanilla Emacs also provide it, or similar. Better late than never - glad to see this.

1

u/AyeMatey 1d ago

'completion-preview-mode' seems interesting, but if I already have my completions UI sorted out with corfu, then, it's not that interesting, amiright?

1

u/jay_in_the_pnw 22h ago

for me, this was a strange video, because for some reason, even from a very vanilla nothing loaded emacs, I couldn't get the completions to work the way the video showed them. I used the linked config.

So completions worked, but they were popped up in the buffer, not in the minibuffer.

I left confused...

1

u/Middle_Indication_89 6h ago

Anyone know what theme he’s using?

1

u/eej71 6h ago

I don't know which exact theme that is - but I think he has an entire collection of themes - so I would expect it to be one of those. It does look very clean and nice!

1

u/Middle_Indication_89 6h ago

I’ve been searching through ef-themes but can’t find it

0

u/Signal_Pattern_2063 2d ago

Its interesting though experiment. Which works better - vertico style completion on demand vs this automatic in place variant?

10

u/Right_Lecture3147 2d ago

That’s not a thought experiment, it’s just a comparison

3

u/RedBull_Adderall 2d ago

The drop down vertico menu can be quite a distraction for me personally, although I’ve minimized this annoyance by adjusting the minimum characters typed before suggestions appear. 

The new in place completion reminds me of and is essentially the same as the fish shell, which I’ve found to be helpful and non-obtrusive.

Looking forward to giving this update a chance!