all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "angelo.graziosi\@libero.it" <angelo.graziosi@libero.it>
Cc: 23510@debbugs.gnu.org
Subject: bug#23510: Strange redisplay in global highlighted mode moving the scroll bar
Date: Wed, 11 May 2016 11:13:05 +0300	[thread overview]
Message-ID: <83oa8dau7i.fsf@gnu.org> (raw)
In-Reply-To: <1959517970.14624161462908686797.JavaMail.httpd@webmail-60.iol.local> (angelo.graziosi@libero.it)

> Date: Tue, 10 May 2016 21:31:26 +0200 (CEST)
> From: "angelo.graziosi@libero.it" <angelo.graziosi@libero.it>
> 
> (global-hl-line-mode 1)
> 
>  
> Now, in the scratch buffer, copy and paste many times its text (;; This 
> buffer...) so that the scratch buffer has many lines, not all contained in the 
> Emacs window/frame. Move the cursor on a line, more or less at the center of 
> the window. The line is highlighted (in green, by default). Now move slowly 
> up/down the scroll bar, then the highlighted line seems to flicker as if it 
> were redrawn at (almost) each pixel movement of the scroll bar.
> 
> Is this to be expected?

I think so.  HL-Line mode works by hooking both pre-command-hook and
post-command-hook; it removes its highlight overlay in the former and
reapplies it in the latter.  When you move the scroll-bar thumb, the
hooks are called several times (at least twice) per mouse drag event,
and since Emacs tracks the mouse moves at pixel granularity, you
usually have much more calls to the hooks.  The result is constant
redrawing of the highlighted line, and that causes flickering.

> Other software with same feature do not show this 
> "flickering" and the highlight moves synchronously with the text.

To reduce the number of redraws, hl-line.el should switch to a
different method of moving the overlay, I think.  I didn't try, so I
cannot be sure this is doable with the existing facilities, but
someone who is motivated enough should try using, e.g.,
pre-redisplay-function.

It could also be that hl-line should be smarter, and refrain from
removing and reapplying the overlay if point didn't move, or stays
within the same screen line.  Again, I didn't try that, so perhaps it
won't work for some reason.





  reply	other threads:[~2016-05-11  8:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10 19:31 bug#23510: Strange redisplay in global highlighted mode moving the scroll bar angelo.graziosi
2016-05-11  8:13 ` Eli Zaretskii [this message]
2016-05-11  9:25   ` Stephen Berman
2016-05-11  9:44     ` Eli Zaretskii
2016-05-12 20:41       ` Stephen Berman
2016-05-12 20:41       ` Stephen Berman
2016-05-13 17:20       ` Stephen Berman
2016-05-13 17:52       ` Stephen Berman
2016-05-14  7:42 ` Angelo Graziosi
2016-05-16 21:33   ` Stephen Berman
2016-05-16 22:28     ` Angelo Graziosi
2016-05-25 22:13       ` Angelo Graziosi
2016-05-26  2:44         ` Eli Zaretskii
2016-05-26  9:34           ` Stephen Berman

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=83oa8dau7i.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=23510@debbugs.gnu.org \
    --cc=angelo.graziosi@libero.it \
    /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.