I just uploaded a short video about Emacs 30 Built-in Completion UI & Styles, which you have find here.

Video notes:

  • When referring to “Emacs Completions”, I refer to Completion Styles & UI
  • I’ve often relied on third-party packages to emulate features from other text editors. For instance, I’ve long used vertico, corfu and orderless.
    • While I still recommend these packages, I became curious about using Emacs without depending on third-party options.
    • My current setup tries to emulate my workflow with the packages mentioned above.
  • The catalyst that pushed me to try the built-in completion is the addition of completion-preview-mode in Emacs 30.

Mini-buffer completions

  • Emacs does not enable “vertical” completions for the mini-buffer by default, but you can enable fido-vertical-mode which comes built-in with Emacs.
    • fido-mode is an enhanced icomplete-mode that emulates ido-mode, also referred to as fake ido-mode.

Completion Styles

  • Changing completion-styles example:
 (setf completion-styles '(basic flex))
  • There is a plethora of completion styles, builtin styles include flex, which provides “fuzzy” completions.

Completion UI & Code completions

  • Emacs built-in completions have a distinctive approach.
  • Instead of displaying a popup at point, a new Completions buffer appears when invoking completion-at-point.

Example configuration:

(setf completion-styles '(basic flex)
      completion-auto-select t ;; Show completion on first call
      completion-auto-help 'visible ;; Display *Completions* upon first request
      completions-format 'one-column ;; Use only one column
      completions-sort 'historical ;; Order based on minibuffer history
      completions-max-height 20 ;; Limit completions to 15 (completions start at line 5)
      completion-ignore-case t)