GNU bug report logs - #26525
`sit-for' in Flyspell slows typing down, hogs 90% of CPU

Previous Next

Package: emacs;

Reported by: Clément Pit-Claudel <cpitclaudel <at> gmail.com>

Date: Sat, 15 Apr 2017 20:29:02 UTC

Severity: normal

Tags: unreproducible

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Clément Pit-Claudel <cpitclaudel <at> gmail.com>
Cc: 26525 <at> debbugs.gnu.org
Subject: bug#26525: `sit-for' in Flyspell slows typing down, hogs 90% of CPU
Date: Mon, 17 Apr 2017 10:14:17 +0300
> From: Clément Pit-Claudel <cpitclaudel <at> gmail.com>
> Date: Sat, 15 Apr 2017 16:33:56 -0400
> 
> The relevant piece of code seems to be this:
> 
>       (cond
>        ((get this-command 'flyspell-deplacement)
> 	(not (eq flyspell-previous-command this-command)))
>        ((get this-command 'flyspell-delayed)
> 	;; The current command is not delayed, that
> 	;; is that we must check the word now.
> 	(and (not unread-command-events)
> 	     (sit-for flyspell-delay)))
>        (t t)))
> 
> But the condition and the comment seem at odds, and it doesn't say much about why it calls `sit-for`.

I'm not quite sure what needs to be explained.  I think the doc string
of flyspell-delay and flyspell-default-delayed-commands tell the whole
story; if something is unclear there, please say what is unclear.

If you want to see this feature in action, turn on Flyspell, then type
something like "ssss", and then wait _without_ typing any non-word
character.  You will see that the mis-spelled word is marked only
after 3 sec, the default value of flyspell-delay.  Then contrast that
with the same word with a space typed after it.

IOW, this is a feature designed to avoid annoying users who type
slowly or make short breaks after typing only part of a word.




This bug report was last modified 4 years and 200 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.