2

There are already questions on disabling flyspell (see: https://stackoverflow.com/questions/3423638)

However I would like to toggle flyspell at runtime.

An annoyance I've found is the red-underline persists, even once flyspell has been disabled.

Closing and opening the file refreshes, but that's impractical.

eg:

(turn-off-flyspell) (flyspell-mode 0) ;; force refresh of highlighting (doesn't work) (font-lock-fontify-buffer) 

Is there a way to clear underlined text?

1 Answer 1

2

flyspell-delete-all-overlays is a built-in non-interactive function, which is called by turn-off-flyspell.

2
  • Thanks for the hint, it works but for some reason I need to call it directly. (flyspell-mode 0) (turn-off-flyspell) fails. Adding (flyspell-delete-all-overlays) afterwards works. Commented Mar 14, 2018 at 1:54
  • It sounds like something is interfering with turning off flyspell-mode in your setup, e.g., buffer narrowed, indirect-buffer is involved in the equation, ... You might want to spend some time working with a minimal example and then gradually work-up to your full-setup until you track down what is causing the interference .... Commented Mar 14, 2018 at 2:12

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.