Subject: Re: bug#32280: 26.1; FLYSPELL-BUFFER sometimes misbehaves for some input in a large enough buffer

From: Eli Zaretskii <[email-masked]>
Date: Fri, 27 Jul 2018 15:45:27 +0300

> From: Artem Boldarev <[email-masked]>
> Date: Thu, 26 Jul 2018 12:44:26 +0300
> 
> Checking large enough buffer with FlySpell leads to the unexpected
> results (at least, when spell checking Russian, but I believe that it is
> possible to reproduce the bug for other languages, at least Ukrainian).
> 
> For example, when checking large enough buffer (large enough to trigger
> flyspell-large-region) I got the following messages in the *Messages*
> buffer:
> 
> Local Ispell dictionary set to ru_RU
> Starting new Ispell process hunspell with ru_RU dictionary...
> Checking region...
> Spell Checking...100% [посимвольно]
> Spell Checking completed.
>   -> смом - 346: word not found
>   -> стостояния - 319: word not found
>   -> рекрсивного - 308: word not found
>   -> универсальнее - 266: word not found
>   -> генериует - 222: word not found
> 
> It was not able to find the misspelt words to highlight them in the 
> buffer which I tried
> to spell check. On the other hand, some not misspelt words were 
> highlighted (именно,
> бесконечный, усложняет).  Under other circumstances, these words are not 
> highlighted as misspelt (which is as it should be).

Can you post the text where this happens?

> The problem turned out to be in the flyspell-external-point-words: It
> makes some heuristic checks before calling (flyspell-word nil t). It
> seems that these checks are OK for English, as I never encountered any
> problems when spell-checking English texts.
> 
> Here is the version of the function which seems to be correct:

AFAICT, you have removed a single line:

			     (< found-length misspell-length)

Can you take me through your reasoning why this line is incorrect, and
what assumptions it made that are correct for English, but not for
Russian?

Thanks.