d12frosted / flyspell-correct

Distraction-free words correction with flyspell via selected interface.
Other
200 stars 14 forks source link

Point should not be moved by command #14

Closed sooheon closed 5 years ago

sooheon commented 8 years ago

Whether a match does or does not occur (at point or before), point should be left in place after correction. Make use of save-excursion?

d12frosted commented 8 years ago

Thanks for reporting.

d12frosted commented 8 years ago

I investigated this issue a bit. Looks like flyspell-get-word moves the point. But I wonder what is the desired behaviour. There are following possible solutions:

  1. Move point to the end of word in any case.
  2. Move point to the end of word only on successful correction.
  3. Don't move point at all.

End of word here means the end of word as flyspell understands it.

Looks like all packages built around flyspell-get-word use behaviour (1). And everyone is happy about it. Because it's not common to try to correct the word without any mistakes :D

I'll leave this issue open for now to see what others have to say :)

sooheon commented 8 years ago

Hm I guess if this function continues to be called for word at point, this behaviour is fine. However, if we allow to correct words away from point, like a sentence or two ago, the point should not move, imo. Then, it makes sense just to not have it move in any case, for consistency. FWIW, I'm coming from speck, and it has the behaviour I described: point never moves when correcting in either direction, or on unsuccessful invocation.

d12frosted commented 5 years ago

I know it took quite a while, but I think that current master has desired behavior. Cheers? 😸