2

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

Regards

Drew
  • 77,472
  • 10
  • 114
  • 243
Vaibhav
  • 583
  • 3
  • 16

2 Answers2

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 Jan 02 '20 at 06:47
0

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.

Karthik
  • 31
  • 3