all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: 20285@debbugs.gnu.org
Subject: bug#20285: 25.0.50; blink-cursor-mode sometimes stops blinking
Date: Sat, 11 Apr 2015 07:54:52 +0200	[thread overview]
Message-ID: <87r3rrxl8z.fsf@gnu.org> (raw)
In-Reply-To: <jwvsic7fylg.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Fri, 10 Apr 2015 17:50:16 -0400")

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>> I can at least confirm that `blink-cursor-timer-function' runs every 0.5
>> seconds and toggles the visibility state of the cursor.  When that state
>> doesn't appear on the screen, then what else can it be except for a
>> skipped redisplay.
>
> Of course, I don't know what it is, but it could be many other things,
> such as a successful redisplay which somehow just didn't think the
> relevant window needed to be refreshed.
> Or a misinterpretation of the state of the cursor?
> Or maybe the cursor state is indeed changed, but not in the right window?

That happens also when there is just one window (except the minibuffer
window).  And when there are more, the cursors in the other windows stay
hollow boxes.  I haven't noticed that one of them disappeared completely
yet.

>> Maybe the interval is 0.8 seconds sometimes when emacs is under heavy
>> load.  But the timer not being run is definitely not the cause for not
>> blinking for up to 10 seconds here.
>>> Have you tried to call `redisplay' explicitly from the blink-cursor
>>> timer?
>> Yes, then it blinks fine even under stress.
>
> Great, so that would hint at redisplay being skipped, indeed.
> Revision 9e77c1b7bcfd0807be7fe67daf73c2320e864309 changed the way we
> decide when to skip a redisplay recently.  The change should make us
> skip redisplay strictly less often rather than more often, but maybe
> there's a problem in that change.
>
> You could also use a pre-redisplay-function to count how many times
> redisplay happensin that particular window.

Ok, I used the following code (add-function because there's already a
pre-redisplay function which I didn't want to replace):

--8<---------------cut here---------------start------------->8---
(defvar th/redisplay-count 0)

(defun th/count-redisplays (windows)
  (when (or (null windows)
            (eq windows t)
            (memq (selected-window) windows))
    (incf th/redisplay-count)))

(add-function :before pre-redisplay-function #'th/count-redisplays)
--8<---------------cut here---------------end--------------->8---

Then I switched to some large latex buffer, did M-: (setq
th/redisplay-count 0), and then started compiling that document to
generate some load.  Then I waited for exactly one minute in which there
has been at least one phase of almost 10 seconds with the cursor being
invisible on the screen before getting the value of th/redisplay-count.

And the value is seven hundred something every time I test.  That's more
than 10 redisplays of the selected window per second!  I didn't do
anything in that one minute so there shouldn't have been a reason for
redisplay to kick in except for the blinking cursor.  And that would
suggest 120 redisplays.

Of course, it's still possible that during the 10 seconds where the
cursor was invisible on the screen there hasn't been a redisplay of the
selected window, but how can I know?

Bye,
Tassilo





  reply	other threads:[~2015-04-11  5:54 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09 14:50 bug#20285: 25.0.50; blink-cursor-mode sometimes stops blinking Tassilo Horn
2015-04-09 15:06 ` Eli Zaretskii
2015-04-09 16:07   ` Eli Zaretskii
2015-04-10  7:46     ` Tassilo Horn
2015-04-10  7:58       ` Eli Zaretskii
2015-04-10  9:28         ` Tassilo Horn
2015-04-10 12:42           ` Eli Zaretskii
2015-04-10 13:13             ` Tassilo Horn
2015-04-10 13:28               ` Eli Zaretskii
2015-04-10 13:32               ` Eli Zaretskii
2015-04-10 14:13                 ` Tassilo Horn
2015-04-10 17:32                   ` Eli Zaretskii
2015-04-10 20:52                     ` Tassilo Horn
2015-04-11  6:25                       ` Eli Zaretskii
2015-04-10 18:24                   ` Stefan Monnier
2015-04-10 18:42                     ` Eli Zaretskii
2015-04-10 20:21                     ` Tassilo Horn
2015-04-10 21:50                       ` Stefan Monnier
2015-04-11  5:54                         ` Tassilo Horn [this message]
2015-04-11  7:34                           ` Eli Zaretskii
2015-04-11 11:34                             ` Eli Zaretskii
2015-04-11 11:49                             ` Tassilo Horn
2015-04-11 12:39                               ` Tassilo Horn
2015-04-11 14:45                                 ` Eli Zaretskii
2015-04-11 19:24                                   ` Tassilo Horn
2015-04-11 19:45                                     ` Eli Zaretskii
2015-04-11 20:17                                       ` Tassilo Horn
2015-04-11 14:02                               ` Stefan Monnier
2015-04-11 14:30                                 ` Tassilo Horn
2015-04-11 14:48                                   ` Eli Zaretskii
2015-04-11 15:14                                   ` Eli Zaretskii
2015-04-12  4:05                                   ` Stefan Monnier
2015-04-11  6:30                         ` Eli Zaretskii
2022-04-28 10:50 ` Lars Ingebrigtsen
2022-04-28 11:48   ` Tassilo Horn
2022-04-28 11:51     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r3rrxl8z.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=20285@debbugs.gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.