0

There are words that are considered to be wrong by Flyspell that are instead considered correct by Ispell. I thought that Flyspell was merely an async version of Ispell, I must be wrong...

To add to the confusion, there cases in which ispell-buffer finds nothing, but ispell-word instead considers some words in the buffer to be wrong, coherently to what Flyspell has to say.

Here's an example:

$ echo http://example.com >/tmp/test
$ emacs -Q /tmp/test

Then execute M-x flyspell-buffer. The word http is now marked as wrong, in fact, ispell-word shows the usual interactive menu. Yet, M-x ispell-buffer completes without finding any wrong words.

Can you help me understanding what's going on here?

1 Answer 1

2

Flyspell tries to respect Ispell as much as possible (e.g., ispell-program-name and ispell-dictionary), but does not use the functionalities exposed by Ispell to do the spell checking.

ispell-buffer uses ispell-begin-skip-region-regexp to skip over some parts of the buffer; this is what causes it to skip over http.

If you create a buffer called *Ispell Debug* and then enable debugging by evaluating (defvar ispell-debug-buffer "*Ispell Debug*"), you will see ispell-buffer print something along the lines of

ispell-region: Search for first region to skip after (ispell-begin-skip-region-regexp)
ispell-region: First skip: http://example.com at (pos,line,column): (1,1,0).

in *Ispell Debug*. ispell-word does not do any of this skipping.

1
  • Thank you, that makes sense. Side question: how can I achieve coherence between the two? Or should I just use Flyspell and ditch the rest? I really want something that just works as expected... I know it's a broad term and that we're talking about Emacs here :) but I'm open to suggestions, even third-party packages will do. In all these years I've never managed to use spellchecking in Emacs without feeling pain.
    – cYrus
    Commented Dec 10, 2021 at 13:25

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.