From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#23510: Strange redisplay in global highlighted mode moving the scroll bar Date: Wed, 11 May 2016 11:13:05 +0300 Message-ID: <83oa8dau7i.fsf@gnu.org> References: <1959517970.14624161462908686797.JavaMail.httpd@webmail-60.iol.local> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1462954464 22398 80.91.229.3 (11 May 2016 08:14:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 May 2016 08:14:24 +0000 (UTC) Cc: 23510@debbugs.gnu.org To: "angelo.graziosi\@libero.it" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 11 10:14:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b0PHY-0000LJ-WD for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 May 2016 10:14:13 +0200 Original-Received: from localhost ([::1]:50919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0PHY-00020x-3x for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 May 2016 04:14:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0PHU-0001y0-2E for bug-gnu-emacs@gnu.org; Wed, 11 May 2016 04:14:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0PHN-0002jD-UP for bug-gnu-emacs@gnu.org; Wed, 11 May 2016 04:14:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0PHN-0002j9-RB for bug-gnu-emacs@gnu.org; Wed, 11 May 2016 04:14:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b0PHN-00075A-Nd for bug-gnu-emacs@gnu.org; Wed, 11 May 2016 04:14:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 May 2016 08:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23510 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23510-submit@debbugs.gnu.org id=B23510.146295439227159 (code B ref 23510); Wed, 11 May 2016 08:14:01 +0000 Original-Received: (at 23510) by debbugs.gnu.org; 11 May 2016 08:13:12 +0000 Original-Received: from localhost ([127.0.0.1]:46642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b0PGa-00073z-0Y for submit@debbugs.gnu.org; Wed, 11 May 2016 04:13:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51823) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b0PGX-00073l-SU for 23510@debbugs.gnu.org; Wed, 11 May 2016 04:13:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0PGN-0002SP-LG for 23510@debbugs.gnu.org; Wed, 11 May 2016 04:13:04 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0PGN-0002SL-I5; Wed, 11 May 2016 04:12:59 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4710 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1b0PGM-0003ZJ-74; Wed, 11 May 2016 04:12:58 -0400 In-reply-to: <1959517970.14624161462908686797.JavaMail.httpd@webmail-60.iol.local> (angelo.graziosi@libero.it) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:118100 Archived-At: > Date: Tue, 10 May 2016 21:31:26 +0200 (CEST) > From: "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.