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#16621: 24.3.50; Periodic timer + overlays = flickering near point Date: Sun, 02 Feb 2014 18:39:48 +0200 Message-ID: <838utt4gff.fsf@gnu.org> References: <87r47m72ft.fsf@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1391367903 5527 80.91.229.3 (2 Feb 2014 19:05:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Feb 2014 19:05:03 +0000 (UTC) Cc: 16621@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 02 20:05:08 2014 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 1WA2Lo-0006F7-EA for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Feb 2014 20:05:04 +0100 Original-Received: from localhost ([::1]:42413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WA2Ln-0006Qp-R9 for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Feb 2014 14:05:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WA2Lg-0006Nb-6P for bug-gnu-emacs@gnu.org; Sun, 02 Feb 2014 14:05:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WA2La-0005eR-Py for bug-gnu-emacs@gnu.org; Sun, 02 Feb 2014 14:04:55 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WA06Q-0004jy-Li for bug-gnu-emacs@gnu.org; Sun, 02 Feb 2014 11:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WA06Q-0007pi-Cc for bug-gnu-emacs@gnu.org; Sun, 02 Feb 2014 11:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Feb 2014 16:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16621 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16621-submit@debbugs.gnu.org id=B16621.139135920830047 (code B ref 16621); Sun, 02 Feb 2014 16:41:02 +0000 Original-Received: (at 16621) by debbugs.gnu.org; 2 Feb 2014 16:40:08 +0000 Original-Received: from localhost ([127.0.0.1]:46556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WA05W-0007oW-Vn for submit@debbugs.gnu.org; Sun, 02 Feb 2014 11:40:07 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:53534) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WA05T-0007oB-6k for 16621@debbugs.gnu.org; Sun, 02 Feb 2014 11:40:04 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0N0D00I00NEOP900@a-mtaout20.012.net.il> for 16621@debbugs.gnu.org; Sun, 02 Feb 2014 18:40:01 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N0D00IZ9NMPD8A0@a-mtaout20.012.net.il>; Sun, 02 Feb 2014 18:40:01 +0200 (IST) In-reply-to: <87r47m72ft.fsf@yandex.ru> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:84458 Archived-At: > From: Dmitry Gutov > 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.