Is it possible to add my personal custom list of words to the company database. Kindly guide me in a simple way. I am not a programmer.


Yes, it is possible. I use the following.

 (setq company-ispell-available t)
 (setq company-ispell-dictionary "/path/to/your/wordlist/file")
 (add-to-list 'company-backends 'company-ispell)

The other answers are valid alternatives, here we are passing a custom-populated file to company to help auto-complete.


Can't give you an answer regarding Company, but I would assume that it provides that possibility.

Otherwise, the built-in, old but still very useful library completion.el offers that possibility. From the doc (which is only in the file's Commentary section):

;;   Completions are automatically saved from one session to another
;; (unless save-completions-flag or enable-completion is nil).
;; Activating this minor-mode (calling completion-initialize) loads
;; a completions database for a saved completions file
;; (default: ~/.completions).  When you exit, Emacs saves a copy of the
;; completions that you often use.  When you next start, Emacs loads in
;; the saved completion file.

I suppose you use company's backend company-ispell to input plain words,

Insert below code into your ~/.emacs.d/init.el,

(defvar my-ispell-words

(defadvice ispell-lookup-words (after ispell-lookup-words-after-hack activate)
  (let* ((word (car (ad-get-args 0)))
         (my-words (all-completions word my-ispell-words) ))
    (when my-words
      (setq ad-return-value (nconc my-words ad-return-value)))))

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.