Subject: bug#20285: 25.0.50; blink-cursor-mode sometimes stops blinking

From: Tassilo Horn <[email-masked]>
Date: Fri, 10 Apr 2015 09:46:46 +0200

Eli Zaretskii <[email-masked]> writes:

>> > Sometimes it occurs to me that `blink-cursor-mode' stops blinking the
>> > cursor for some time.  That temporary stop might also occur in the
>> > off-phase so that there's no visible cursor anymore.  As soon as I press
>> > some key, the blinking starts again.  But just now in some specific
>> > buffer, it'll blink twice and then disappear until I press a key again.
>> 
>> It generally means that some other time, probably an idle time, takes
>> more than 0.5 sec to do its job.   ^^^^                   ^^^^
>
> Sorry, "timer".
>
>> Look at your other times, and find the one which takes too much time
>> for doing its job. ^^^^^
>
> "timers"

Yes, got that.  There are quite a few timers in `timer-list' and
`timer-idle-list'.

,----[ C-h v timer-idle-list RET ]
| timer-idle-list is a variable defined in `C source code'.
| Its value is shown below.
| 
| Documentation:
| List of active idle-time timers in order of increasing time.
| 
| Value: ([t 0 0 125000 t show-paren-function nil idle 0]
|  [t 0 0 500000 t jit-lock-context-fontify nil idle 0]
|  [t 0 0 500000 t
|     #[0 "\204	\205\n\303>?\205\304 \207"
| 	[eldoc-mode global-eldoc-mode eldoc-documentation-function
| 		    (nil ignore)
| 		    eldoc-print-current-symbol-info]
| 	2]
|     nil idle 0]
|  [t 0 0 500000 t highlight-symbol-temp-highlight nil idle 0]
|  [t 0 0 500000 0.5 blink-cursor-start nil idle 0]
|  [nil 0 1 199999 t reftex-view-crossref-when-idle nil idle 999999]
|  [nil 0 2 0 t adict-guess-dictionary-maybe
|       (#<buffer diss.tex>)
|       idle 0])
`----

Is it documented somewhere what the individual entries of these vectors
mean?  The fifth entry seems to be the SECS or REPEAT argument given to
`run-with-{,idle-}timer', the sixth entry is the function to run, and
the seventh is the function's args, but what are the other entries?

But anyway, I think even when there's some timer that takes too long,
the cursor should never disappear completely.  So maybe a redisplay
should be forced whenever the cursor is set to visible again and there
has been a redisplay when the cursor has been invisible.  That would
ensure that if blinking stops due to a timer or processing of input, at
least it stops in the visible state at the cost of at most one redisplay
which hadn't happened otherwise.

Bye,
Tassilo