GNU bug report logs -
#20285
25.0.50; blink-cursor-mode sometimes stops blinking
Previous Next
Reported by: Tassilo Horn <tsdh <at> gnu.org>
Date: Thu, 9 Apr 2015 14:52:02 UTC
Severity: minor
Tags: moreinfo
Found in version 25.0.50
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Tassilo Horn <tsdh <at> gnu.org>
> Cc: 20285 <at> debbugs.gnu.org
> Date: Fri, 10 Apr 2015 11:28:52 +0200
>
> I think that it should be generically possible from Lisp to check if a
> redisplay has been performed within a given time frame. That might be
> useful for other stuff next to `blink-cursor-mode', too.
>
> That could be achieved by `redisplay' increasing some integer
> redisplay_counter variable whose value can be accessed from Lisp.
But "was redisplay performed?" does not have a simple yes/no answer.
Depending on the circumstances, the display engine can decide to
redisplay one or more windows on one or more frames. By contrast, you
(in this case) are only interested in the selected window on the
selected frame. So I don't think a simple counter will cut it; you
might need a counter per window or some such. And other use cases
might want something even more fine-granular, perhaps.
> Then `blink-cursor-timer-function' could check if the invisibility of
> the cursor has really been manifested (on the glass) and force a
> redisplay when toggling it visible again.
>
> --8<---------------cut here---------------start------------->8---
> (defvar blink-cursor-redisplay-counter nil)
>
> (defun blink-cursor-timer-function ()
> "Timer function of timer `blink-cursor-timer'."
> (let ((cursor-shown (internal-show-cursor-p)))
> (internal-show-cursor nil (not cursor-shown))
> ;; If the cursor was invisible in the last cycle and a redisplay has been
> ;; performed there, ensure a redisplay now so that it won't end up
> ;; invisible for an indefinite amount of time.
> (unless (or cursor-shown
> (= blink-cursor-redisplay-counter
> redisplay-counter))
> (redisplay 'force))
> (setq blink-cursor-redisplay-counter redisplay-counter))
What happens if the blink-cursor timer doesn't get run?
> The effect would be that if a timer running too long or processing input
> stops the blinking of the cursor, that would at happen at least in the
> visible cursor state.
If it started with the cursor visible, yes. But what if the heavy
processing started with the cursor blinked off, and the timer function
didn't get to run for a long time?
This bug report was last modified 3 years and 26 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.