all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 16621@debbugs.gnu.org
Subject: bug#16621: 24.3.50; Periodic timer + overlays = flickering near point
Date: Sun, 02 Feb 2014 18:39:48 +0200	[thread overview]
Message-ID: <838utt4gff.fsf@gnu.org> (raw)
In-Reply-To: <87r47m72ft.fsf@yandex.ru>

> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Sun, 02 Feb 2014 03:01:26 +0200
> 
> It happens with different overlays, and with the default monospaced font

I don't think this is related to overlays, not directly anyway.

> of my system (Ubuntu GNU/Linux), but it's easiest to reproduce doing
> isearch, and using Fira Mono (TrueType version, available from
> https://www.mozilla.org/en-US/styleguide/products/firefox-os/typeface/,
> see the bottom of the page). Steps from emacs -Q:
> 
> 1. Evaluate (run-at-time nil 0.01 'ignore)
> 
> 2. Evaluate (set-face-attribute 'default nil :height 105 :family "Fira Mono")
> 
> This is optional, but with the default font the flickering is harder to
> reproduce.
> 
> 3. Open a text file press C-s (or C-r), enter some letters, preferably
> common to that file, press C-s or C-r again. Repeat multiple times.
> Maybe do that for a couple of minutes, even.
> 
> 4. Observe flickering letters, usually one to the left, or one to the
> right of the cursor.
> 
> Most of the time the flickering happens 2 or 3 times and stops

No, it doesn't stop, at least not with the above recipe.  To see that,
type "M-x trace-redisplay RET" while running the above experiment --
on my system, this causes the flickering to become much more prominent
and never stop, until I exit isearch and type some simple command,
like C-f, afterwards (to remove the echo-area message).

I'm guessing that the apparent cease of the flickering is actually due
to the fact that the timer frequency is an integral multiple of the
hardware screen update rate (but I didn't pursue this line of
investigation, as I don't think it is of interest).

> This is in no way limited to isearch. For example, I can also see it
> when typing, when using the fancy highlight-tail-mode
> (http://www.emacswiki.org/emacs-en/highlight-tail.el), at least with
> settings highlight-tail-steps 14, highlight-tail-timer 0.02.

What you see is result of redrawing the cursor at a very high
frequency.  Normally, redrawing the cursor would only flicker the
character below the cursor, but with some fonts, the adjacent
characters are also affected, if the character under the cursor
"overhangs" to the left and/or to the right into the neighboring
character cells -- then Emacs redraws those adjacent characters as
well.

Why is the cursor redrawn with such a high frequency, you ask?
Because of the timer that expires every 10 msec.  When some timer
expires, Emacs always triggers redisplay.  If it didn't, features like
highlight-tail could not produce their effect.

When a timer expires and triggers redisplay, and nothing have changed
on display, Emacs normally sees that, and doesn't update the screen.
But if there is an echo-area message, like the one displayed by
isearch, this optimization is disabled, and we redisplay the echo
area.  Redisplaying the echo area involves calling the frame update
function, which redraws the cursor.  And that is what you see in the
isearch case.

With highlight-tail-mode, I see flickering only when I type text.
This is expected, since typing text modifies the color of the overlays
at a very high frequency (50 Hz with your customizations), which again
requires redrawing the current line and the cursor.  If you see
something else with highlight-tail-mode, please describe the recipe.

All of the above is quite normal, so I don't see where there would be
a bug.  Granted, Emacs 24.3 and Emacs 23 behave the same.

Thanks.





  parent reply	other threads:[~2014-02-02 16:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-02  1:01 bug#16621: 24.3.50; Periodic timer + overlays = flickering near point Dmitry Gutov
2014-02-02  2:33 ` Stefan Monnier
2014-02-02  2:37   ` Dmitry Gutov
2014-02-02 16:39 ` Eli Zaretskii [this message]
2014-02-03  2:12   ` Stefan Monnier
2014-02-03  5:47     ` Eli Zaretskii
2014-02-03 13:41       ` Stefan Monnier
2014-02-03 16:14         ` Eli Zaretskii
2014-02-04  3:28           ` Stefan Monnier
2014-02-04  3:44             ` Eli Zaretskii
2014-02-04  2:34   ` Dmitry Gutov
2014-02-04  3:48     ` Eli Zaretskii
2014-02-04  6:17       ` Dmitry Gutov
2014-02-04 16:00         ` Eli Zaretskii
2014-02-04 22:08           ` Jan D.
2014-02-05  3:57             ` Eli Zaretskii
2014-02-05  6:02               ` Jan Djärv
2014-02-05 15:40                 ` Eli Zaretskii
2014-02-05 13:46               ` Stefan Monnier
2014-02-05 15:59                 ` Eli Zaretskii
2014-02-05 18:57                   ` Stefan Monnier
2014-02-05 20:00                     ` Eli Zaretskii
2014-02-05 21:46                       ` Stefan Monnier
2014-02-06  5:56                         ` Eli Zaretskii
2014-02-06 13:08                           ` Stefan Monnier
2014-02-06 14:20                             ` Eli Zaretskii

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=838utt4gff.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=16621@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /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.