Overview

Company is a modular text completion framework for GNU Emacs.

In other words, it is a package for retrieving, manipulating, and displaying text completion candidates. It aims to assist developers, writers, and scientists during code and text writing.


Terminology

Completion is an act of intelligibly guessing possible variants of words based on already typed characters. To complete a word means to insert a correctly guessed variant into the buffer.

Consequently, the candidates are the aforementioned guessed variants of words. Each of the candidates has the potential to be chosen for successful completion. And each of the candidates contains the initially typed characters: either only at the beginning (so-called prefix matches), or also inside (non-prefix matches) of a candidate 1.

The package’s name Company is based on the combination of the two words: ‘Complete’ and ‘Anything’. These words reflect the package’s commitment to handling completion candidates and its extensible nature allowing it to cover a wide range of usage scenarios.


Structure

The Company is easily extensible because its significant building blocks are pluggable modules: backends (see Backends) and frontends (see Frontends).

The backends are responsible for retrieving completion candidates; which are then outputted by the frontends. For an easy and quick initial setup, Company is supplied with the preconfigured sets of the backends and frontends. The default behavior of the modules can be adjusted per particular needs, goals, and preferences. It is also typical to utilize backends from a variety of third-party libraries, developed to be pluggable with Company.

But Company consists not only of the backends and frontends.

A core of the package plays the role of a controller, connecting the modules, making them work together; and exposing configurations and commands for a user to operate with. For more details, Customization and Commands.

Also, Company is bundled with an alternative workflow configuration company-tng — defining company-tng-frontend, company-tng-mode, and company-tng-map — that allows performing completion with just TAB. To enable this configuration, add the following line to the Emacs initialization file (see (emacs)Init File):

(add-hook 'after-init-hook 'company-tng-mode)

Footnotes

(1)

A good starting point to learn about types of matches is to play with the Emacs’s user option completion-styles. For illustrations on how Company visualizes the matches, see Frontends.