16

company-ispell can complete a word at point, but what if you want to use Company to list the possible corrections for spelling?

As an added bonus, is there any way to integrate this into Flyspell?

6
  • 1
    A related question: emacs.stackexchange.com/q/8129/2609.
    – Name
    Commented Mar 6, 2015 at 12:32
  • 1
    @Name Well, that's talking about a pure elisp spell-checking engine, not an interface to that engine. This question is more the spirit of what I'm asking, but the present question has a much narrower scope. Commented Mar 6, 2015 at 12:45
  • 1
    I'm afraid someone would have to reimplement ispell-command-loop to use company-mode. There doesn't seem to be an easy way to replace its prompting logic.
    – Dmitry
    Commented Mar 6, 2015 at 14:15
  • 3
    I'm really interested in an answer to this question, and I'm going to try to solve it myself when I get the chance. In the mean time, there's some lisp on Emacs Wiki that uses popup.el to display corrections: emacswiki.org/emacs/FlySpell#toc11 Maybe someone familiar with company can hack it togther.
    – nanny
    Commented Mar 6, 2015 at 14:39
  • 3
    While working on a solution for this, I came across this package helm-flyspell
    – nanny
    Commented Mar 11, 2015 at 16:38

2 Answers 2

6

There are already some different ways to show ispell correction candidates, I guess you just meant correcting misspelled word in a popup menu, not company-mode itself.

To correct misspelled word at point, both built-in M-$ (ispell-word) and C-c $ (flyspell-correct-word-before-point) works great, the former uses a buffer to show correction choices, while the later uses a GUI popup menu:

Running flyspell-correct-word-before-point on "flyspell"


There are also some other interface like popup and helm:

flyspell-popup:

flyspell-popup demo

helm-flyspell:

enter image description here

2
  • 1
    Useful answer, but I did mean what I asked :) Commented Jun 28, 2015 at 14:49
  • 1
    Oh, I see, I misunderstood you.
    – xuchunyang
    Commented Jun 28, 2015 at 16:00
0

It seems that back in 2016 Henry Weller implemented a working company back-end for flyspell, as it was discussed here. The source-code is not available on the link there anymore, but I've contacted Henry if he still happens to have it somewhere.

I was told that the code last worked with Emacs 26.3, but since then the dump-emacs function has been deprecated, and the code would need to be upgraded accordingly.

I've uploaded the code here. Have a look, and get in touch if would like to contribute!

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.