Pergunta

I have found it annoying that flyspell seems to stay in the middle of the word when you do flyspell-auto-correct-word command. Can this be changed to force it to go to the end of the word after running the command? It might be as simple as setting a key binding to auto-complete-word and then move-forward-word which I know how to do. But this won't work in all cases because sometimes it puts the cursor behind the word if the auto-complete word was smaller than the typed word. Any help on this would be great.

Foi útil?

Solução

Try this code:

(eval-after-load "flyspell"
  '(defun flyspell-ajust-cursor-point (save cursor-location old-max)
     (when (not (looking-at "\\b"))
       (forward-word))))

Tested with flyspell version 1.7k, and with the version shipped with Emacs 23.2.

Outras dicas

I looked through the (defun flyspell-auto-correct-word ...) and I can't see any good hooks or other customization points there so I think your best bet is to use C-h f defadvice:

(defadvice flyspell-auto-correct-word (after flyspell-forward-word activate) (flyspell-goto-next-error))
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top