Subject: Re: bug#30462: flyspell-auto-correct-word 'corrects' more than the current word

From: 積丹尼 Dan Jacobson <[email-masked]>
Date: Sun, 18 Feb 2018 07:37:22 +0800

OK thanks. I'll try the patch in a few moments, but there is just one
more thing I want to say... which exposes a bug in view-lossage... but
probably even deeper...

 b [self-insert-command]
 e e [self-insert-command]
 h h [self-insert-command]
 a a [self-insert-command]
 v v [self-insert-command]
 u u [self-insert-command]
 o o [self-insert-command]
 u u [self-insert-command]
 <backspace> <backspace> [delete-backward-char]
 <backspace> <backspace> [delete-backward-char]
 <backspace> <backspace> [delete-backward-char]
 i i [self-insert-command]
 o o [self-insert-command]
 r r [self-insert-command]
 <escape> <escape> <tab> [flyspell-auto-correct-word]
 C-e [move-end-of-line]
 C-h l [view-lossage]

Uh oh, what did it correct this time? I thought it might have changed
behaviour into behavior like I wished. But looking closely, I had
already in fact typed behavior... So instead it probably went on one of
its long hunting missions... uh oh. Hmmm, checking *Messages* doesn't
show any of its usual choices...

Sure, blame me for trying to correct an already correct word.
But just like two wrongs don't make a right, two rights shouldn't make a
wrong.

No I don't know why lossage shows two

ABCdef
abcdef

I just tried an experiment.
Typing exactly eight characters, a b c ESC TAB d e f

C-h l runs the command view-lossage. It says

 a [self-insert-command]
 b b [self-insert-command]
 c c [self-insert-command]
 <escape> <escape> <tab> [flyspell-auto-correct-word]
 d [self-insert-command]
 e e [self-insert-command]
 f f [self-insert-command]

It shows two <escape>s !

Now let's try a real a b c ESC ESC TAB d e f
 a [self-insert-command]
 b b [self-insert-command]
 c c [self-insert-command]
 <escape> <escape> <escape> <tab> [nil]
 d [self-insert-command]
 e e [self-insert-command]
 f f [self-insert-command]

Three <escape>s!

Only this flyspell stuff is affected. Other ESC commands have OK lossage:

 <escape> g [goto-line]
 9 [self-insert-command]
 9 [self-insert-command]
 <return> [exit-minibuffer]

 <escape> x [execute-extended-command]
 w [self-insert-command]
 h [self-insert-command]
 o [self-insert-command]...

No wonder I can't unbind flyspell-auto-correct-word... it's on some
astral plane...