I use emacs-org for my "non-programming" work. I need a completion framework. Present completion framework like completion.el, dabbreav, pabbrev and company provide single word completion.

I need something to complete a sentence like -- Generalised painless progressive distention of abdomen -- Generalised painless progressively increasing jaundice. On typing Generalised , I should get these options. Is it possible


  • This answer to a similar, but not duplicate, question could be useful. Commented Jun 4, 2020 at 13:01

2 Answers 2


abbrev can abbreviate text. Use a numeric argument to say how many words before point should be taken as the expansion. For example, to abbreviate the sentence "The cat and the mooon." as x, put the point at the end and do

C-u 5 C-x a g x <RET>

The emacs manual (info) for Abbrevs gives the details.

  • 1
    @m34capThat is abbreviation expansion, and not auto-complete. Getting a suggestion as soon as you start typing is more useful it is more natural
    – Vaibhav
    Commented Jan 2, 2020 at 6:47

You can use hippie-expand:

(setq hippie-expand-try-functions-list '(try-expand-line))
(global-set-key (kbd "C-;") 'hippie-expand)

Now C-; should expand to the closest matching line. Repeating the command will get you all the matches.

Finally, if you want a popup menu with the choices listed there are some hacky ways of plugging hippie-expand into company-mode, but I'm not sure they work well. You can check the github page for company-mode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.