1

On loading large files (~2000+ lines for example), flyspell takes a few seconds to Run.

Is there a way to have flyspell delay applying to the entire buffer on load?

Only run on visible text for instance? Or run multiple processes to get the job done faster?


Edit: this was caused by:

(add-hook 'flyspell-mode-hook 'flyspell-buffer)

Think this question should be closed.

  • I do not believe that flyspell checks the entire buffer by default when the minor-mode is initialized. Instead, the default behavior is to check only the surrounding text as you type or move the cursor. You may wish to find out where you changed the default behavior and reverse it -- e.g., comment it out in your user-configuration. Try with emacs -q -- (require 'flyspell) and set just the ispell-program-name and then type M-x flyspell-mode on a large buffer. – lawlist Jan 22 '17 at 23:22
  • I just tried with emacs -q using the above-mentioned settings and I was able to immediately initialize flyspell-mode on a buffer containing 114,437 lines of code -- no delay or wait whatsoever using Emacs 25.1. As stated above, the default behavior is to only check words surrounding point -- not the entire buffer. – lawlist Jan 22 '17 at 23:31
  • @lawlist, the file had many comments, linked in question. – ideasman42 Jan 23 '17 at 2:03
  • Possible duplicate of How to speed up flyspell-mode? – ideasman42 May 23 at 8:37
  • @ideasman42: if you think your question is a duplicate, feel free to close it. As describe your problem is different (it's not that editing is sluggish, but that opening the file takes a lot of time). But flyspell already "only run[s] on visible text", so your description of the problem doesn't match our understanding of flyspell. I suggest you file a bug report or investigate on your side what's really going on and then fix your question. – Stefan May 23 at 12:01
1

While not delaying flyspell, this suggestion is offered by the wiki for flyspell performance in general:

I highly suggest setting ‘flyspell-issue-message-flag’ to nil, as printing messages for every word (when checking the entire buffer) causes an enormous slowdown. – nschum

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.