After running flyspell-buffer, all misspelled words are highlighted. However, after saving a word, all of the highlighting is gone. How can I avoid that? My flyspell-persistent-highlight is set t.

  • If you add a word to the dictionary and ispell (used by flyspell) thinks the word is now correctly spelled, how does ispell (used by flyspell) know to continue marking it as misspelled each time your cursor gets near that word (assuming that you have flyspell-mode enabled, that is)? – lawlist Feb 12 '17 at 16:31
  • If you wish to break flyspell-do-correct you can comment out the (fs-unhighlight-at cursor-location) statements within said function. – lawlist Feb 12 '17 at 16:36
  • 2
    @lawlist Its not about the added word, but all other misspelled words in the buffer. – xuhdev Feb 12 '17 at 18:14
  • 1
    I am wondering about this too. I have the same problem. After saving a word to the dictionary, I have to hit flyspell-buffer again. – tirocinium Apr 24 '17 at 0:20

Via https://www.emacswiki.org/emacs/FlySpell#toc9 and https://www.reddit.com/r/emacs/comments/4oc7pg/spellcheck_flyspellmode_underlines_disappear_when/d5l9vtt/ I found this solution:

(defun flyspell-buffer-after-pdict-save (&rest _)

(advice-add 'ispell-pdict-save :after #'flyspell-buffer-after-pdict-save)

Unfortunately this seems to trigger a bit too often: flyspell-buffer now also runs after correcting a word or even after dismissing the mouse-2 menu without any action.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.