]> code.delx.au - gnu-emacs-elpa/blob - packages/company-statistics/README.org
Merge commit '0cda39255827f283e7578cd469ae42daad9556a2' from js2-mode
[gnu-emacs-elpa] / packages / company-statistics / README.org
1 * company-statistics
2 ** About
3 Company-statistics is a global minor mode built on top of the in-buffer
4 completion system [[http://company-mode.github.io/][company-mode]]. The idea is to keep a log of a certain number
5 of completions you choose, along with some context information, and use that to
6 rank candidates the next time you have to choose --- hopefully showing you
7 likelier candidates at the top of the list.
8 ** Use It
9 Using the package is simple.
10
11 If you install it from the elpa.gnu.org repository with Emacs' package manager,
12 you only need to enable the mode, e.g., in your =init.el= file:
13 #+begin_src emacs-lisp
14 (add-hook 'after-init-hook 'company-statistics-mode)
15 #+end_src
16
17 Alternatively, make sure =company-statistics.el= is in your =load-path=, and add
18 to your =init.el= file
19 #+begin_src emacs-lisp
20 (require 'company-statistics)
21 (company-statistics-mode)
22 #+end_src
23 to load the package manually and turn on the mode.
24
25 See the (few but powerful) customizable options for details =M-x customize-group
26 company-statistics=.
27 ** Design
28 Company-statistics is an add-on for company-mode, but is only loosely coupled to
29 it (it works by adding a sorting function to =company-transformers= as well as a
30 handler to =company-completion-finished-hook=). It is designed with some
31 flexibility in mind as for the recorded context information and the way
32 candidates are scored: the default pair of functions are only examples! The
33 stats are automatically persistent between sessions.
34 ** Have Fun!