From unknown Fri Jun 20 07:08:58 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#23510 <23510@debbugs.gnu.org> To: bug#23510 <23510@debbugs.gnu.org> Subject: Status: Strange redisplay in global highlighted mode moving the scroll bar Reply-To: bug#23510 <23510@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:08:58 +0000 retitle 23510 Strange redisplay in global highlighted mode moving the scrol= l bar reassign 23510 emacs submitter 23510 "angelo.graziosi@libero.it" severity 23510 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue May 10 16:11:16 2016 Received: (at submit) by debbugs.gnu.org; 10 May 2016 20:11:16 +0000 Received: from localhost ([127.0.0.1]:46279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b0Dzv-0007Qq-Cf for submit@debbugs.gnu.org; Tue, 10 May 2016 16:11:16 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42274) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b0DRA-0006bI-DT for submit@debbugs.gnu.org; Tue, 10 May 2016 15:35:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0DR4-00036d-84 for submit@debbugs.gnu.org; Tue, 10 May 2016 15:35:15 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59535) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0DR4-00036Z-4X for submit@debbugs.gnu.org; Tue, 10 May 2016 15:35:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0DR2-0007m9-NB for bug-gnu-emacs@gnu.org; Tue, 10 May 2016 15:35:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0DQy-000350-EW for bug-gnu-emacs@gnu.org; Tue, 10 May 2016 15:35:11 -0400 Received: from smtp-33.italiaonline.it ([212.48.25.161]:38710 helo=libero.it) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0DNR-00026B-GN for bug-gnu-emacs@gnu.org; Tue, 10 May 2016 15:35:08 -0400 Received: from webmail-60.iol.local ([10.255.26.9]) by smtp-33.iol.local with SMTP id 0DNObGZTVSJj70DNObABAU; Tue, 10 May 2016 21:31:26 +0200 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1462908686; bh=jeUFx6Aqj1nQk2iFxBbCLtw9x1RGK5CMJ63qugtl1Ws=; h=Date:From:Reply-To:To:Subject; b=Dx0Dnyx/wQvdDV5axP3AAAo/qnEjoCPgetUllIUbXQ8v209NhgBhHNfQMTqhoCFOY 35L35g1T/eKW9lRZvanmTErOp8G/BYKMv0imbh/vkkLnz2SOPoKuuziRmOXOYkZAz6 +8Z0x6dlHzJaaVcllv/6ouCIy/Xq9yYZZZtunPrdzZCO4PWV0aSqPxdIpSOIHFREAu g0G5+KopsAZyK1ZUuP/zAVSbyU6mBHkHXASop43ZEYcDFP4RcVgWlKJM6giSZpsun7 B1mXvA1pu3xNrtG76e+1XW/fTpMRLH3Rw8MNQ0bzd+nimEG2kyTl2wXALWpvy3ZOQ9 l7wNQioi7nSMQ== X-CNFS-Analysis: v=2.2 cv=M/MPEG4s c=1 sm=1 tr=0 a=VniVPhP7twji+KQUmLNibA==:117 a=0mClgMIORTEA:10 a=SwiS5gpXoSYA:10 a=cEh0b3m783MA:10 a=IkcTkHD0fZMA:10 a=T7_8-SjPmPKBAyco0w4A:9 Message-ID: <1959517970.14624161462908686797.JavaMail.httpd@webmail-60.iol.local> Date: Tue, 10 May 2016 21:31:26 +0200 (CEST) From: "angelo.graziosi@libero.it" To: bug-gnu-emacs@gnu.org Subject: Strange redisplay in global highlighted mode moving the scroll bar MIME-Version: 1.0 Content-Type: text/plain;charset="UTF-8" Content-Transfer-Encoding: 7bit X-SenderIP: 87.6.233.94 X-libjamv: 9OiFlWvNx34= X-libjamsun: MKrlnDeQqIwQ9cWKo5G0/MokA226ReT+RqFD5jjaGfs= X-CMAE-Envelope: MS4wfGf9gC74IvFDDxlhx98F/B5k9XntvNEIr4He0ewIuM+WG3aOkFeeV+VoIu2m2Gxw6M9GcmLhvVmyMVpCuGAun3XQYBIT7J1yPSysClyEPQRqWZlj959T 5247McvLUTi2zIExzvesSOD8/EIv/9spf7PSo1uuIttnoK0NzuTUvuynXyLRuFUo+RUNKqaJqyyUvQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 10 May 2016 16:11:13 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: "angelo.graziosi@libero.it" Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) Maybe this is not a bug but I want to flag for completeness.. The following should be reproducible with the following simple init.el: $ cat init.el ;; (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? Other software with same feature do not show this "flickering" and the highlight moves synchronously with the text. The effect is visible not only with vertical scroll bar but also with the horizontal. I see this with my master builds on Windows, GNU/linux and OSX. Angelo From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 04:13:12 2016 Received: (at 23510) by debbugs.gnu.org; 11 May 2016 08:13:12 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 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 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 Date: Wed, 11 May 2016 11:13:05 +0300 Message-Id: <83oa8dau7i.fsf@gnu.org> From: Eli Zaretskii To: "angelo.graziosi\@libero.it" In-reply-to: <1959517970.14624161462908686797.JavaMail.httpd@webmail-60.iol.local> (angelo.graziosi@libero.it) Subject: Re: bug#23510: Strange redisplay in global highlighted mode moving the scroll bar References: <1959517970.14624161462908686797.JavaMail.httpd@webmail-60.iol.local> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.1 (-------) X-Debbugs-Envelope-To: 23510 Cc: 23510@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.1 (-------) > 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. From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 05:25:41 2016 Received: (at 23510) by debbugs.gnu.org; 11 May 2016 09:25:41 +0000 Received: from localhost ([127.0.0.1]:46687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b0QOj-0000Q0-8w for submit@debbugs.gnu.org; Wed, 11 May 2016 05:25:41 -0400 Received: from mout.gmx.net ([212.227.17.22]:53899) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b0QOh-0000Po-Kn for 23510@debbugs.gnu.org; Wed, 11 May 2016 05:25:40 -0400 Received: from rosalinde ([89.245.116.29]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MfAog-1bFB401Rve-00OlM8; Wed, 11 May 2016 11:25:26 +0200 From: Stephen Berman To: Eli Zaretskii Subject: Re: bug#23510: Strange redisplay in global highlighted mode moving the scroll bar References: <1959517970.14624161462908686797.JavaMail.httpd@webmail-60.iol.local> <83oa8dau7i.fsf@gnu.org> Date: Wed, 11 May 2016 11:25:24 +0200 In-Reply-To: <83oa8dau7i.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 11 May 2016 11:13:05 +0300") Message-ID: <8760ul9caj.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:0gAlh0yyGpqN37HgRzAueIYI4DUgimkU85KA6Xl9KV/AA1fOE+M eVNJz0BU+ZdqQL6LcZK5S1w9Xk49GCp/8thkmgzrKOlefXAqy7hnzWA8ZzieI8Pzg0shjDX 4SaM6wGFK2T9UcKlkdRrR4HVUgEpWS27cPH+ycxCsYUJllgmS9OUNn1ivbuTABs1eI9gnkO XqHNlMKNnDHbH3LZMpgLA== X-UI-Out-Filterresults: notjunk:1;V01:K0:AYqMEgYFZT0=:1O7s8vvOipIRRwD2XGIxwI ajkRwDAZeRd7UKipKaL7YcTXqg622uJJgUpDIbzLd3VUlhmqCRRuroAPIuk52bcj41YPguljc Gs7a17v6f1WbuVkZ52lF4ANjdHER4yGF7jRjd6dFs3Tf4tJ+lhqFVF5rLkyFXBVAw2Boy8G7P EAq2mmNPYW+y8or5Dk3W1hFpPsVxRUVwFtMDlgXQqmdLSNquPwi/3NPl4zCELVvtNAXiWghL7 Y+RRcYhhYs9OdfgtKwcr3+3mYsg4szweE7ebRyCyBRKsDn0rXiv1yJTCxwdsxRoNOTgz15TOS 32jE2WcXTkRpYtyXx4LKfJc/S1nSsCLp2HfFfZjN96447qdpWlGRwlzRnDY6vT84HCXjtGdi6 bO0KjoAxqPvxaAOwlw1yELlmaTJdGfTMDYlaiWqTwNX82vwp2oYl920QTau0Ar9VY8a0CRseg XnHRIo6eKVczv6nbGnzKqGAFq0W1qaWhkrJg5a49HK3wjMl80SRSOJ7I5tawRmqfHtTV5wOHy LBTMfa2phbo+4A6ij1Cdex2XeTemQce5G9pa/eBvVbOuhj99NJ5JJM4kJRDd4ifi5xfC4rZ9r lSUbPq0EdJJVC1Hf0UepPN6VK0sgpW/zuPjLW7fyVqJqK7ZBuFeoeEsjMBprleZjtM4eEicfs 8w6l1J/rdZp1R5d1jUUFEVuaZWZrk4JO9kYbhsDAcqdt7PHDeotMUwF5cuXYB2LUWMvVSFRwW Y6PbocslRNM+FO8Zhu2/GtFKMR0xsWyrRRGjVQGskVWeibJwiVII2WQRNvYG779PQJ7UbAzj5 glGKyeH X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 23510 Cc: 23510@debbugs.gnu.org, "angelo.graziosi@libero.it" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) On Wed, 11 May 2016 11:13:05 +0300 Eli Zaretskii wrote: >> 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. What you say about the use of pre- and post-command-hook and moving overlays may well be (perhaps the main) part of the problem here, but I found out that there's an specific condition inducing it: I noticed that the flickering only happens when global-hl-line-mode is enabled, but not when hl-line-mode is enabled, and it turns out that the crucial difference between them is that in the former, global-hl-line-sticky-flag is nil by default, while in the latter, hl-line-sticky-flag is t by default: when I set global-hl-line-sticky-flag to t and then enable global-hl-line-mode, the flickering no longer happens, and when I set hl-line-sticky-flag to nil and then enable hl-line-mode, the flickering does happen. Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 05:44:50 2016 Received: (at 23510) by debbugs.gnu.org; 11 May 2016 09:44:50 +0000 Received: from localhost ([127.0.0.1]:46725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b0QhG-0000sK-0Z for submit@debbugs.gnu.org; Wed, 11 May 2016 05:44:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44288) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b0QhE-0000s8-AT for 23510@debbugs.gnu.org; Wed, 11 May 2016 05:44:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0Qh3-00075s-OJ for 23510@debbugs.gnu.org; Wed, 11 May 2016 05:44:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0Qh3-00075o-L6; Wed, 11 May 2016 05:44:37 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4914 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1b0Qh2-0000hv-EZ; Wed, 11 May 2016 05:44:37 -0400 Date: Wed, 11 May 2016 12:44:43 +0300 Message-Id: <83lh3hapys.fsf@gnu.org> From: Eli Zaretskii To: Stephen Berman In-reply-to: <8760ul9caj.fsf@gmx.net> (message from Stephen Berman on Wed, 11 May 2016 11:25:24 +0200) Subject: Re: bug#23510: Strange redisplay in global highlighted mode moving the scroll bar References: <1959517970.14624161462908686797.JavaMail.httpd@webmail-60.iol.local> <83oa8dau7i.fsf@gnu.org> <8760ul9caj.fsf@gmx.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.1 (-------) X-Debbugs-Envelope-To: 23510 Cc: 23510@debbugs.gnu.org, angelo.graziosi@libero.it X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.1 (-------) > From: Stephen Berman > Cc: "angelo.graziosi\@libero.it" , 23510@debbugs.gnu.org > Date: Wed, 11 May 2016 11:25:24 +0200 > > What you say about the use of pre- and post-command-hook and moving > overlays may well be (perhaps the main) part of the problem here, but I > found out that there's an specific condition inducing it: I noticed that > the flickering only happens when global-hl-line-mode is enabled, but not > when hl-line-mode is enabled, and it turns out that the crucial > difference between them is that in the former, > global-hl-line-sticky-flag is nil by default, while in the latter, > hl-line-sticky-flag is t by default: when I set > global-hl-line-sticky-flag to t and then enable global-hl-line-mode, the > flickering no longer happens, and when I set hl-line-sticky-flag to nil > and then enable hl-line-mode, the flickering does happen. If you can suggest a patch that fixes that and doesn't have any adverse effects, please do. From debbugs-submit-bounces@debbugs.gnu.org Fri May 13 15:58:37 2016 Received: (at 23510) by debbugs.gnu.org; 13 May 2016 19:58:38 +0000 Received: from localhost ([127.0.0.1]:50253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b1JEL-0000nj-EC for submit@debbugs.gnu.org; Fri, 13 May 2016 15:58:37 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:36552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b1JEH-0000nT-1W for 23510@debbugs.gnu.org; Fri, 13 May 2016 15:58:35 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 90DBF1612D0; Fri, 13 May 2016 12:58:27 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id JS-mh9wmY45e; Fri, 13 May 2016 12:58:26 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0513D1612D2; Fri, 13 May 2016 12:58:26 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ZJIjujnup3xM; Fri, 13 May 2016 12:58:25 -0700 (PDT) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id DA22D1612D0; Fri, 13 May 2016 12:58:25 -0700 (PDT) Subject: Fwd: Strange redisplay in global highlighted mode moving the scroll bar References: <87twi1spp8.fsf@rub.de> To: 23510@debbugs.gnu.org From: Paul Eggert Organization: UCLA Computer Science Department X-Forwarded-Message-Id: <87twi1spp8.fsf@rub.de> Message-ID: <340f5d14-dbd0-77ec-1898-756bec2c9ba8@cs.ucla.edu> Date: Fri, 13 May 2016 12:58:25 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <87twi1spp8.fsf@rub.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 23510 Cc: Eli Zaretskii , angelo.graziosi@libero.it X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) [Steve Berman asked me to forward the following, as he has had trouble sending email to debbugs.] -------- Forwarded Message -------- On Wed, 11 May 2016 12:44:43 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: "angelo.graziosi\@libero.it" , >> 23510@debbugs.gnu.org >> Date: Wed, 11 May 2016 11:25:24 +0200 >> >> What you say about the use of pre- and post-command-hook and moving >> overlays may well be (perhaps the main) part of the problem here, but I >> found out that there's an specific condition inducing it: I noticed that >> the flickering only happens when global-hl-line-mode is enabled, but not >> when hl-line-mode is enabled, and it turns out that the crucial >> difference between them is that in the former, >> global-hl-line-sticky-flag is nil by default, while in the latter, >> hl-line-sticky-flag is t by default: when I set >> global-hl-line-sticky-flag to t and then enable global-hl-line-mode, the >> flickering no longer happens, and when I set hl-line-sticky-flag to nil >> and then enable hl-line-mode, the flickering does happen. > > If you can suggest a patch that fixes that and doesn't have any > adverse effects, please do. Ok, I've given it a try; patch below. Debugging showed that the flickering is caused by calling delete-overlay on pre-command-hook, so I eliminated the uses of this hook and replaced them with the new functions hl-line-maybe-unhighlight and global-hl-line-maybe-unhighlight added to post-command-hook that call delete-overlay under more specific conditions. According to my tests this does not lead to flickering and highlights and unhighlights as before (but others should test the code, in case I missed or messed up anything). I also noticed that the definition of global-hl-line-mode fails to remove global-hl-line-highlight from change-major-mode-hook when the mode is disabled; I assume this was an oversite, so I rectified it. If my fix is found acceptable, I assume it should go to master, since the flickering problem was probably always there, so is not a regression in emacs-25. With that in mind, I took the opportunity to make global-hl-line-mode automatically taken effect in all live windows when global-hl-line-sticky-flag is non-nil (the new function global-hl-line-highlight-all); in the current (and I assume original) implementation, enabling global-hl-line-mode only highlights the current line of the selected window, even when global-hl-line-sticky-flag is non-nil (the highlighting appears in other windows when they become selected). This change seems consistent with the idea of Global-Hl-Line mode, expressed in its doc string ("Toggle line highlighting in all buffers"). I tested it with three windows in each of two frames (the most that comfortably fit on my display), and the highlighting was as fast as with two windows on one frame, but I suppose it's possible that more windows on more frames might be slower. Steve Berman diff --git a/lisp/hl-line.el b/lisp/hl-line.el index 25c8a08..642a8ba 100644 --- a/lisp/hl-line.el +++ b/lisp/hl-line.el @@ -126,6 +126,9 @@ hl-line-range-function This variable is expected to be made buffer-local by modes.") +(defvar hl-line-overlay-buffer nil + "Most recently visited buffer in which Hl-Line mode is enabled.") + ;;;###autoload (define-minor-mode hl-line-mode "Toggle highlighting of the current line (Hl-Line mode). @@ -142,22 +145,21 @@ hl-line-mode When `hl-line-sticky-flag' is nil, Hl-Line mode highlights the line about point in the selected window only. In this case, it -uses the function `hl-line-unhighlight' on `pre-command-hook' in +uses the function `hl-line-maybe-unhighlight' in addition to `hl-line-highlight' on `post-command-hook'." :group 'hl-line (if hl-line-mode (progn ;; In case `kill-all-local-variables' is called. (add-hook 'change-major-mode-hook #'hl-line-unhighlight nil t) - (if hl-line-sticky-flag - (remove-hook 'pre-command-hook #'hl-line-unhighlight t) - (add-hook 'pre-command-hook #'hl-line-unhighlight nil t)) (hl-line-highlight) - (add-hook 'post-command-hook #'hl-line-highlight nil t)) + (setq hl-line-overlay-buffer (current-buffer)) + (add-hook 'post-command-hook #'hl-line-highlight nil t) + (add-hook 'post-command-hook #'hl-line-maybe-unhighlight)) (remove-hook 'post-command-hook #'hl-line-highlight t) (hl-line-unhighlight) (remove-hook 'change-major-mode-hook #'hl-line-unhighlight t) - (remove-hook 'pre-command-hook #'hl-line-unhighlight t))) + (remove-hook 'post-command-hook #'hl-line-maybe-unhighlight t))) (defun hl-line-make-overlay () (let ((ol (make-overlay (point) (point)))) @@ -181,6 +183,22 @@ hl-line-unhighlight (when hl-line-overlay (delete-overlay hl-line-overlay))) +(defun hl-line-maybe-unhighlight () + "Maybe deactivate the Hl-Line overlay on the current line. +Specifically, when `hl-line-sticky-flag' is nil deactivate all +such overlays in all buffers except the current one." + (let ((hlob hl-line-overlay-buffer) + (curbuf (current-buffer))) + (when (and (not hl-line-sticky-flag) + (not (eq curbuf hlob)) + (not (minibufferp))) + (with-current-buffer hlob + (when (overlayp hl-line-overlay) + (delete-overlay hl-line-overlay)))) + (when (and (overlayp hl-line-overlay) + (eq (overlay-buffer hl-line-overlay) curbuf)) + (setq hl-line-overlay-buffer curbuf)))) + ;;;###autoload (define-minor-mode global-hl-line-mode "Toggle line highlighting in all buffers (Global Hl-Line mode). @@ -189,25 +207,24 @@ global-hl-line-mode the mode if ARG is omitted or nil. If `global-hl-line-sticky-flag' is non-nil, Global Hl-Line mode -highlights the line about the current buffer's point in all +highlights the line about the current buffer's point in all live windows. -Global-Hl-Line mode uses the functions `global-hl-line-unhighlight' and -`global-hl-line-highlight' on `pre-command-hook' and `post-command-hook'." +Global-Hl-Line mode uses the functions `global-hl-line-highlight' +and `global-hl-line-maybe-unhighlight' on `post-command-hook'." :global t :group 'hl-line (if global-hl-line-mode (progn ;; In case `kill-all-local-variables' is called. (add-hook 'change-major-mode-hook #'global-hl-line-unhighlight) - (if global-hl-line-sticky-flag - (remove-hook 'pre-command-hook #'global-hl-line-unhighlight) - (add-hook 'pre-command-hook #'global-hl-line-unhighlight)) - (global-hl-line-highlight) - (add-hook 'post-command-hook #'global-hl-line-highlight)) + (global-hl-line-highlight-all) + (add-hook 'post-command-hook #'global-hl-line-highlight) + (add-hook 'post-command-hook #'global-hl-line-maybe-unhighlight)) (global-hl-line-unhighlight-all) - (remove-hook 'pre-command-hook #'global-hl-line-unhighlight) - (remove-hook 'post-command-hook #'global-hl-line-highlight))) + (remove-hook 'post-command-hook #'global-hl-line-highlight) + (remove-hook 'change-major-mode-hook #'global-hl-line-unhighlight) + (remove-hook 'post-command-hook #'global-hl-line-maybe-unhighlight))) (defun global-hl-line-highlight () "Highlight the current line in the current window." @@ -222,11 +239,33 @@ global-hl-line-highlight (selected-window))) (hl-line-move global-hl-line-overlay)))) +(defun global-hl-line-highlight-all () + "Highlight the current line in all live windows." + (walk-windows (lambda (w) + (with-current-buffer (window-buffer w) + (global-hl-line-highlight))) + nil t)) + (defun global-hl-line-unhighlight () "Deactivate the Global-Hl-Line overlay on the current line." (when global-hl-line-overlay (delete-overlay global-hl-line-overlay))) +(defun global-hl-line-maybe-unhighlight () + "Maybe deactivate the Global-Hl-Line overlay on the current line. +Specifically, when `global-hl-line-sticky-flag' is nil deactivate +all such overlays in all buffers except the current one." + (mapc (lambda (ov) + (let ((ovb (overlay-buffer ov))) + (when (and (not global-hl-line-sticky-flag) + (bufferp ovb) + (not (eq ovb (current-buffer))) + (not (minibufferp))) + (with-current-buffer ovb + (when (overlayp global-hl-line-overlay) + (delete-overlay global-hl-line-overlay)))))) + global-hl-line-overlays)) + (defun global-hl-line-unhighlight-all () "Deactivate all Global-Hl-Line overlays." (mapc (lambda (ov) From debbugs-submit-bounces@debbugs.gnu.org Sat May 14 03:42:43 2016 Received: (at 23510) by debbugs.gnu.org; 14 May 2016 07:42:43 +0000 Received: from localhost ([127.0.0.1]:50410 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b1UDj-0002ZK-5h for submit@debbugs.gnu.org; Sat, 14 May 2016 03:42:43 -0400 Received: from smtp201.alice.it ([82.57.200.97]:18578) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b1UDh-0002Z0-Fa for 23510@debbugs.gnu.org; Sat, 14 May 2016 03:42:41 -0400 Received: from [192.168.1.103] (95.246.229.228) by smtp201.alice.it (8.6.060.43) (authenticated as angelo.graziosi@alice.it) id 573572EF0036D99E; Sat, 14 May 2016 09:42:26 +0200 To: 23510@debbugs.gnu.org From: Angelo Graziosi Subject: Re: Strange redisplay in global highlighted mode moving the scroll bar Message-ID: <583a66be-763b-1a75-45be-b892eeacb48e@alice.it> Date: Sat, 14 May 2016 09:42:13 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 23510 Cc: Eli Zaretskii , stephen.berman@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) > If my fix is found acceptable I have tested the patch with this init.el file: ;; (global-hl-line-mode 1) and it seems to work.. Any other configuration for testing? Ciao, Angelo. From debbugs-submit-bounces@debbugs.gnu.org Mon May 16 13:43:23 2016 Received: (at 23510) by debbugs.gnu.org; 16 May 2016 17:43:23 +0000 Received: from localhost ([127.0.0.1]:54178 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2MY7-0007cf-4c for submit@debbugs.gnu.org; Mon, 16 May 2016 13:43:23 -0400 Received: from out2.mail.ruhr-uni-bochum.de ([134.147.42.229]:57934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2MY1-0007cG-CY for 23510@debbugs.gnu.org; Mon, 16 May 2016 13:43:21 -0400 Received: from mx2.mail.ruhr-uni-bochum.de (localhost [127.0.0.1]) by out2.mail.ruhr-uni-bochum.de (Postfix mo-ext) with ESMTP id 3r5xSP3sm3z4x1q; Fri, 13 May 2016 19:20:05 +0200 (CEST) Received: from mx2.mail.ruhr-uni-bochum.de (localhost [127.0.0.1]) by mx2.mail.ruhr-uni-bochum.de (Postfix idis) with ESMTP id 3r5xSP3Dllz4wnr; Fri, 13 May 2016 19:20:05 +0200 (CEST) X-Envelope-Sender: X-RUB-Notes: Internal origin=134.147.42.227 Received: from mail1.mail.ruhr-uni-bochum.de (mail1.mail.ruhr-uni-bochum.de [134.147.42.227]) by mx2.mail.ruhr-uni-bochum.de (Postfix mi-int) with ESMTP id 3r5xSN2SCZz4x1v; Fri, 13 May 2016 19:20:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rub.de; s=mail-2016; t=1463160005; bh=EP3Wes0EKBbHR0zB45TCtpvXq+e+uVEUse/m5z3sxXM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=jOzvX3QKqyg8olIqHhNrsv3PVCjzxhVHUOM8UwvtyUtUS9i5igEvGU/J+zdMt0QLT BJB5KRyy0YbcvCXsutTQ5DtV47MLG4TBGuzzaqNxSF0cMCmMQUryOj3FdnPPIxLqCr uIwSpS4KzAH8+ARSRy9nvcH2VWwZOojNAG0nYTvE= X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.98.7 at mx2.mail.ruhr-uni-bochum.de Received: from rosalinde (i59F55FFC.versanet.de [89.245.95.252]) by mail1.mail.ruhr-uni-bochum.de (Postfix) with ESMTPSA id 3r5xSM5g7HzySv; Fri, 13 May 2016 19:20:03 +0200 (CEST) From: Stephen Berman To: Eli Zaretskii Subject: Re: bug#23510: Strange redisplay in global highlighted mode moving the scroll bar References: <1959517970.14624161462908686797.JavaMail.httpd@webmail-60.iol.local> <83oa8dau7i.fsf@gnu.org> <8760ul9caj.fsf@gmx.net> <83lh3hapys.fsf@gnu.org> Date: Fri, 13 May 2016 19:20:03 +0200 In-Reply-To: <83lh3hapys.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 11 May 2016 12:44:43 +0300") Message-ID: <87k2ixub7g.fsf@rub.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Virus-Scanned: clamav-milter 0.98.7 at mail1.mail.ruhr-uni-bochum.de X-Virus-Status: Clean X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 23510 Cc: 23510@debbugs.gnu.org, angelo.graziosi@libero.it X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) [I sent this last night, but it never arrived, so I resent it about an hour ago, but that also hasn't arrived, so now I'm sending again from a different email address.] On Wed, 11 May 2016 12:44:43 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: "angelo.graziosi\@libero.it" , >> 23510@debbugs.gnu.org >> Date: Wed, 11 May 2016 11:25:24 +0200 >> >> What you say about the use of pre- and post-command-hook and moving >> overlays may well be (perhaps the main) part of the problem here, but I >> found out that there's an specific condition inducing it: I noticed that >> the flickering only happens when global-hl-line-mode is enabled, but not >> when hl-line-mode is enabled, and it turns out that the crucial >> difference between them is that in the former, >> global-hl-line-sticky-flag is nil by default, while in the latter, >> hl-line-sticky-flag is t by default: when I set >> global-hl-line-sticky-flag to t and then enable global-hl-line-mode, the >> flickering no longer happens, and when I set hl-line-sticky-flag to nil >> and then enable hl-line-mode, the flickering does happen. > > If you can suggest a patch that fixes that and doesn't have any > adverse effects, please do. Ok, I've given it a try; patch below. Debugging showed that the flickering is caused by calling delete-overlay on pre-command-hook, so I eliminated the uses of this hook and replaced them with the new functions hl-line-maybe-unhighlight and global-hl-line-maybe-unhighlight added to post-command-hook that call delete-overlay under more specific conditions. According to my tests this does not lead to flickering and highlights and unhighlights as before (but others should test the code, in case I missed or messed up anything). I also noticed that the definition of global-hl-line-mode fails to remove global-hl-line-highlight from change-major-mode-hook when the mode is disabled; I assume this was an oversite, so I rectified it. If my fix is found acceptable, I assume it should go to master, since the flickering problem was probably always there, so is not a regression in emacs-25. With that in mind, I took the opportunity to make global-hl-line-mode automatically taken effect in all live windows when global-hl-line-sticky-flag is non-nil (the new function global-hl-line-highlight-all); in the current (and I assume original) implementation, enabling global-hl-line-mode only highlights the current line of the selected window, even when global-hl-line-sticky-flag is non-nil (the highlighting appears in other windows when they become selected). This change seems consistent with the idea of Global-Hl-Line mode, expressed in its doc string ("Toggle line highlighting in all buffers"). I tested it with three windows in each of two frames (the most that comfortably fit on my display), and the highlighting was as fast as with two windows on one frame, but I suppose it's possible that more windows on more frames might be slower. Steve Berman diff --git a/lisp/hl-line.el b/lisp/hl-line.el index 25c8a08..642a8ba 100644 --- a/lisp/hl-line.el +++ b/lisp/hl-line.el @@ -126,6 +126,9 @@ hl-line-range-function This variable is expected to be made buffer-local by modes.") +(defvar hl-line-overlay-buffer nil + "Most recently visited buffer in which Hl-Line mode is enabled.") + ;;;###autoload (define-minor-mode hl-line-mode "Toggle highlighting of the current line (Hl-Line mode). @@ -142,22 +145,21 @@ hl-line-mode When `hl-line-sticky-flag' is nil, Hl-Line mode highlights the line about point in the selected window only. In this case, it -uses the function `hl-line-unhighlight' on `pre-command-hook' in +uses the function `hl-line-maybe-unhighlight' in addition to `hl-line-highlight' on `post-command-hook'." :group 'hl-line (if hl-line-mode (progn ;; In case `kill-all-local-variables' is called. (add-hook 'change-major-mode-hook #'hl-line-unhighlight nil t) - (if hl-line-sticky-flag - (remove-hook 'pre-command-hook #'hl-line-unhighlight t) - (add-hook 'pre-command-hook #'hl-line-unhighlight nil t)) (hl-line-highlight) - (add-hook 'post-command-hook #'hl-line-highlight nil t)) + (setq hl-line-overlay-buffer (current-buffer)) + (add-hook 'post-command-hook #'hl-line-highlight nil t) + (add-hook 'post-command-hook #'hl-line-maybe-unhighlight)) (remove-hook 'post-command-hook #'hl-line-highlight t) (hl-line-unhighlight) (remove-hook 'change-major-mode-hook #'hl-line-unhighlight t) - (remove-hook 'pre-command-hook #'hl-line-unhighlight t))) + (remove-hook 'post-command-hook #'hl-line-maybe-unhighlight t))) (defun hl-line-make-overlay () (let ((ol (make-overlay (point) (point)))) @@ -181,6 +183,22 @@ hl-line-unhighlight (when hl-line-overlay (delete-overlay hl-line-overlay))) +(defun hl-line-maybe-unhighlight () + "Maybe deactivate the Hl-Line overlay on the current line. +Specifically, when `hl-line-sticky-flag' is nil deactivate all +such overlays in all buffers except the current one." + (let ((hlob hl-line-overlay-buffer) + (curbuf (current-buffer))) + (when (and (not hl-line-sticky-flag) + (not (eq curbuf hlob)) + (not (minibufferp))) + (with-current-buffer hlob + (when (overlayp hl-line-overlay) + (delete-overlay hl-line-overlay)))) + (when (and (overlayp hl-line-overlay) + (eq (overlay-buffer hl-line-overlay) curbuf)) + (setq hl-line-overlay-buffer curbuf)))) + ;;;###autoload (define-minor-mode global-hl-line-mode "Toggle line highlighting in all buffers (Global Hl-Line mode). @@ -189,25 +207,24 @@ global-hl-line-mode the mode if ARG is omitted or nil. If `global-hl-line-sticky-flag' is non-nil, Global Hl-Line mode -highlights the line about the current buffer's point in all +highlights the line about the current buffer's point in all live windows. -Global-Hl-Line mode uses the functions `global-hl-line-unhighlight' and -`global-hl-line-highlight' on `pre-command-hook' and `post-command-hook'." +Global-Hl-Line mode uses the functions `global-hl-line-highlight' +and `global-hl-line-maybe-unhighlight' on `post-command-hook'." :global t :group 'hl-line (if global-hl-line-mode (progn ;; In case `kill-all-local-variables' is called. (add-hook 'change-major-mode-hook #'global-hl-line-unhighlight) - (if global-hl-line-sticky-flag - (remove-hook 'pre-command-hook #'global-hl-line-unhighlight) - (add-hook 'pre-command-hook #'global-hl-line-unhighlight)) - (global-hl-line-highlight) - (add-hook 'post-command-hook #'global-hl-line-highlight)) + (global-hl-line-highlight-all) + (add-hook 'post-command-hook #'global-hl-line-highlight) + (add-hook 'post-command-hook #'global-hl-line-maybe-unhighlight)) (global-hl-line-unhighlight-all) - (remove-hook 'pre-command-hook #'global-hl-line-unhighlight) - (remove-hook 'post-command-hook #'global-hl-line-highlight))) + (remove-hook 'post-command-hook #'global-hl-line-highlight) + (remove-hook 'change-major-mode-hook #'global-hl-line-unhighlight) + (remove-hook 'post-command-hook #'global-hl-line-maybe-unhighlight))) (defun global-hl-line-highlight () "Highlight the current line in the current window." @@ -222,11 +239,33 @@ global-hl-line-highlight (selected-window))) (hl-line-move global-hl-line-overlay)))) +(defun global-hl-line-highlight-all () + "Highlight the current line in all live windows." + (walk-windows (lambda (w) + (with-current-buffer (window-buffer w) + (global-hl-line-highlight))) + nil t)) + (defun global-hl-line-unhighlight () "Deactivate the Global-Hl-Line overlay on the current line." (when global-hl-line-overlay (delete-overlay global-hl-line-overlay))) +(defun global-hl-line-maybe-unhighlight () + "Maybe deactivate the Global-Hl-Line overlay on the current line. +Specifically, when `global-hl-line-sticky-flag' is nil deactivate +all such overlays in all buffers except the current one." + (mapc (lambda (ov) + (let ((ovb (overlay-buffer ov))) + (when (and (not global-hl-line-sticky-flag) + (bufferp ovb) + (not (eq ovb (current-buffer))) + (not (minibufferp))) + (with-current-buffer ovb + (when (overlayp global-hl-line-overlay) + (delete-overlay global-hl-line-overlay)))))) + global-hl-line-overlays)) + (defun global-hl-line-unhighlight-all () "Deactivate all Global-Hl-Line overlays." (mapc (lambda (ov) From debbugs-submit-bounces@debbugs.gnu.org Mon May 16 13:44:58 2016 Received: (at 23510) by debbugs.gnu.org; 16 May 2016 17:44:58 +0000 Received: from localhost ([127.0.0.1]:54196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2MZd-0007fW-T5 for submit@debbugs.gnu.org; Mon, 16 May 2016 13:44:58 -0400 Received: from mout.gmx.net ([212.227.15.15]:57132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2MZb-0007fI-1N for 23510@debbugs.gnu.org; Mon, 16 May 2016 13:44:55 -0400 Received: from rosalinde ([89.245.95.252]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0LrvBu-1bkeA2037m-013iVi; Fri, 13 May 2016 18:21:52 +0200 From: Stephen Berman To: Eli Zaretskii Subject: Re: bug#23510: Strange redisplay in global highlighted mode moving the scroll bar In-Reply-To: <83lh3hapys.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 11 May 2016 12:44:43 +0300") Date: Thu, 12 May 2016 22:41:01 +0200 Lines: 187 References: <1959517970.14624161462908686797.JavaMail.httpd@webmail-60.iol.local> <83oa8dau7i.fsf@gnu.org> <8760ul9caj.fsf@gmx.net> <83lh3hapys.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-From-Line: nobody Thu May 12 22:41:24 2016 Message-ID: <87posqszck.fsf@gmx.net> MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:KlwFDTw5sOsITmemr+bhrNwJFOYJoE+4frAetUqCrN8GvIYbSxI MQa0eVJADbrq66vmUo31jzQ1xpCS3WxFF6HNekQnIL0r9pFf+Nwkw/b0+SS3lux2QMT/b8q N+PWI6zhV5H0u/m5xb/pQrw4F6xKtJj9O2ykzRzvdnJJgie8/kQ4WZRCjtbq24RDkDBdVWp cLWsUbVP+5C2vgORPDAfA== X-UI-Out-Filterresults: notjunk:1;V01:K0:oBc4fPX/0G0=:rKM+xyci7KsJn42nNdYjPZ M050My9Z4bDNC357lsVKCODDzPE+ue80spd9ivnbC1/Xdibcw3bQ1jOWlswYefHOV+Nc321u6 GoarQiTE2HCIfvUR7sXRyXrx5p0nrHu1Y/8T2PMPDcRRP1PvOI/gxvVdpzOiFA6thDsrc9JSR EmRX9mqInaQ57B5vycMmDp//56CYSQY/YAYaaNKP9qMocYIPvl55rvnCRFxAro6a7u0MWB5Sd qv1TUX8cSU35i9PRIDzbY8uyYmv2If2nj4qR9TO0G5FmGoL59iLSTs93sRHya2maD1jYDGmQJ 16rUbh7EMjBZEU3w1GzfrQYvXc8cH5wGxAnW1gxO++iJ7/9+ntqxQsBa6HonV4mAoTLiMG+yp gh/b0WAU2MI/X3aqVmi5H8Gd3AxikqYtX1BNC0lMIOteTXtFk6T2pQeCv9cRqrI+nK0TiVAaK U959DCziargcW3dHaxpme6/MJdMyUC2xAuOkVDGPsTlImcAsI1R5eSAO5EkBfEap7vzYfqec3 1EY3fOxo2TdHP1cWx2BsoUJe/GLLFU8TOm2HRnUK+0Mzv3gV14GG/50x2hyjpNC0HFb/V0eV8 2GJ2DwmiMoOInzLiP6gdV7JvtOJPMSjjCVj/LRUquHQA2N1krVQSEZ5BvTeQk8hjjNSC9X63A D3vy3TgeYWK24GRU+GppQ98eS0x92xClKSQT1s+IF5Y1BNjO88JbWU6PfVBy7CF1Z7kxIJ8dS uWnCJpog7HtA2TQDmUkEK9ruqguliR/ejstm/lOStDXNu82o85BB6ARL3AeSAMRyRb/AFpGWs Rd3sib0NlqZEmuhcbSmLniuLZoYgg== X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 23510 Cc: 23510@debbugs.gnu.org, angelo.graziosi@libero.it X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) [Resending, since I sent this last night but it apparently never arrived; if it took a wrong turn and arrives later, sorry for the duplication.] On Wed, 11 May 2016 12:44:43 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: "angelo.graziosi\@libero.it" , >> 23510@debbugs.gnu.org >> Date: Wed, 11 May 2016 11:25:24 +0200 >> >> What you say about the use of pre- and post-command-hook and moving >> overlays may well be (perhaps the main) part of the problem here, but I >> found out that there's an specific condition inducing it: I noticed that >> the flickering only happens when global-hl-line-mode is enabled, but not >> when hl-line-mode is enabled, and it turns out that the crucial >> difference between them is that in the former, >> global-hl-line-sticky-flag is nil by default, while in the latter, >> hl-line-sticky-flag is t by default: when I set >> global-hl-line-sticky-flag to t and then enable global-hl-line-mode, the >> flickering no longer happens, and when I set hl-line-sticky-flag to nil >> and then enable hl-line-mode, the flickering does happen. > > If you can suggest a patch that fixes that and doesn't have any > adverse effects, please do. Ok, I've given it a try; patch below. Debugging showed that the flickering is caused by calling delete-overlay on pre-command-hook, so I eliminated the uses of this hook and replaced them with the new functions hl-line-maybe-unhighlight and global-hl-line-maybe-unhighlight added to post-command-hook that call delete-overlay under more specific conditions. According to my tests this does not lead to flickering and highlights and unhighlights as before (but others should test the code, in case I missed or messed up anything). I also noticed that the definition of global-hl-line-mode fails to remove global-hl-line-highlight from change-major-mode-hook when the mode is disabled; I assume this was an oversite, so I rectified it. If my fix is found acceptable, I assume it should go to master, since the flickering problem was probably always there, so is not a regression in emacs-25. With that in mind, I took the opportunity to make global-hl-line-mode automatically taken effect in all live windows when global-hl-line-sticky-flag is non-nil (the new function global-hl-line-highlight-all); in the current (and I assume original) implementation, enabling global-hl-line-mode only highlights the current line of the selected window, even when global-hl-line-sticky-flag is non-nil (the highlighting appears in other windows when they become selected). This change seems consistent with the idea of Global-Hl-Line mode, expressed in its doc string ("Toggle line highlighting in all buffers"). I tested it with three windows in each of two frames (the most that comfortably fit on my display), and the highlighting was as fast as with two windows on one frame, but I suppose it's possible that more windows on more frames might be slower. Steve Berman diff --git a/lisp/hl-line.el b/lisp/hl-line.el index 25c8a08..642a8ba 100644 --- a/lisp/hl-line.el +++ b/lisp/hl-line.el @@ -126,6 +126,9 @@ hl-line-range-function This variable is expected to be made buffer-local by modes.") +(defvar hl-line-overlay-buffer nil + "Most recently visited buffer in which Hl-Line mode is enabled.") + ;;;###autoload (define-minor-mode hl-line-mode "Toggle highlighting of the current line (Hl-Line mode). @@ -142,22 +145,21 @@ hl-line-mode When `hl-line-sticky-flag' is nil, Hl-Line mode highlights the line about point in the selected window only. In this case, it -uses the function `hl-line-unhighlight' on `pre-command-hook' in +uses the function `hl-line-maybe-unhighlight' in addition to `hl-line-highlight' on `post-command-hook'." :group 'hl-line (if hl-line-mode (progn ;; In case `kill-all-local-variables' is called. (add-hook 'change-major-mode-hook #'hl-line-unhighlight nil t) - (if hl-line-sticky-flag - (remove-hook 'pre-command-hook #'hl-line-unhighlight t) - (add-hook 'pre-command-hook #'hl-line-unhighlight nil t)) (hl-line-highlight) - (add-hook 'post-command-hook #'hl-line-highlight nil t)) + (setq hl-line-overlay-buffer (current-buffer)) + (add-hook 'post-command-hook #'hl-line-highlight nil t) + (add-hook 'post-command-hook #'hl-line-maybe-unhighlight)) (remove-hook 'post-command-hook #'hl-line-highlight t) (hl-line-unhighlight) (remove-hook 'change-major-mode-hook #'hl-line-unhighlight t) - (remove-hook 'pre-command-hook #'hl-line-unhighlight t))) + (remove-hook 'post-command-hook #'hl-line-maybe-unhighlight t))) (defun hl-line-make-overlay () (let ((ol (make-overlay (point) (point)))) @@ -181,6 +183,22 @@ hl-line-unhighlight (when hl-line-overlay (delete-overlay hl-line-overlay))) +(defun hl-line-maybe-unhighlight () + "Maybe deactivate the Hl-Line overlay on the current line. +Specifically, when `hl-line-sticky-flag' is nil deactivate all +such overlays in all buffers except the current one." + (let ((hlob hl-line-overlay-buffer) + (curbuf (current-buffer))) + (when (and (not hl-line-sticky-flag) + (not (eq curbuf hlob)) + (not (minibufferp))) + (with-current-buffer hlob + (when (overlayp hl-line-overlay) + (delete-overlay hl-line-overlay)))) + (when (and (overlayp hl-line-overlay) + (eq (overlay-buffer hl-line-overlay) curbuf)) + (setq hl-line-overlay-buffer curbuf)))) + ;;;###autoload (define-minor-mode global-hl-line-mode "Toggle line highlighting in all buffers (Global Hl-Line mode). @@ -189,25 +207,24 @@ global-hl-line-mode the mode if ARG is omitted or nil. If `global-hl-line-sticky-flag' is non-nil, Global Hl-Line mode -highlights the line about the current buffer's point in all +highlights the line about the current buffer's point in all live windows. -Global-Hl-Line mode uses the functions `global-hl-line-unhighlight' and -`global-hl-line-highlight' on `pre-command-hook' and `post-command-hook'." +Global-Hl-Line mode uses the functions `global-hl-line-highlight' +and `global-hl-line-maybe-unhighlight' on `post-command-hook'." :global t :group 'hl-line (if global-hl-line-mode (progn ;; In case `kill-all-local-variables' is called. (add-hook 'change-major-mode-hook #'global-hl-line-unhighlight) - (if global-hl-line-sticky-flag - (remove-hook 'pre-command-hook #'global-hl-line-unhighlight) - (add-hook 'pre-command-hook #'global-hl-line-unhighlight)) - (global-hl-line-highlight) - (add-hook 'post-command-hook #'global-hl-line-highlight)) + (global-hl-line-highlight-all) + (add-hook 'post-command-hook #'global-hl-line-highlight) + (add-hook 'post-command-hook #'global-hl-line-maybe-unhighlight)) (global-hl-line-unhighlight-all) - (remove-hook 'pre-command-hook #'global-hl-line-unhighlight) - (remove-hook 'post-command-hook #'global-hl-line-highlight))) + (remove-hook 'post-command-hook #'global-hl-line-highlight) + (remove-hook 'change-major-mode-hook #'global-hl-line-unhighlight) + (remove-hook 'post-command-hook #'global-hl-line-maybe-unhighlight))) (defun global-hl-line-highlight () "Highlight the current line in the current window." @@ -222,11 +239,33 @@ global-hl-line-highlight (selected-window))) (hl-line-move global-hl-line-overlay)))) +(defun global-hl-line-highlight-all () + "Highlight the current line in all live windows." + (walk-windows (lambda (w) + (with-current-buffer (window-buffer w) + (global-hl-line-highlight))) + nil t)) + (defun global-hl-line-unhighlight () "Deactivate the Global-Hl-Line overlay on the current line." (when global-hl-line-overlay (delete-overlay global-hl-line-overlay))) +(defun global-hl-line-maybe-unhighlight () + "Maybe deactivate the Global-Hl-Line overlay on the current line. +Specifically, when `global-hl-line-sticky-flag' is nil deactivate +all such overlays in all buffers except the current one." + (mapc (lambda (ov) + (let ((ovb (overlay-buffer ov))) + (when (and (not global-hl-line-sticky-flag) + (bufferp ovb) + (not (eq ovb (current-buffer))) + (not (minibufferp))) + (with-current-buffer ovb + (when (overlayp global-hl-line-overlay) + (delete-overlay global-hl-line-overlay)))))) + global-hl-line-overlays)) + (defun global-hl-line-unhighlight-all () "Deactivate all Global-Hl-Line overlays." (mapc (lambda (ov) From debbugs-submit-bounces@debbugs.gnu.org Mon May 16 14:55:16 2016 Received: (at 23510) by debbugs.gnu.org; 16 May 2016 18:55:16 +0000 Received: from localhost ([127.0.0.1]:54342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2Nfg-0006EE-04 for submit@debbugs.gnu.org; Mon, 16 May 2016 14:55:16 -0400 Received: from mout.gmx.net ([212.227.15.18]:63998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2Nfd-0006Dx-Gu for 23510@debbugs.gnu.org; Mon, 16 May 2016 14:55:14 -0400 Received: from rosalinde ([89.245.74.113]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MS5QA-1bCOOP2wR8-00THRF; Thu, 12 May 2016 22:41:24 +0200 From: Stephen Berman To: Eli Zaretskii Subject: Re: bug#23510: Strange redisplay in global highlighted mode moving the scroll bar References: <1959517970.14624161462908686797.JavaMail.httpd@webmail-60.iol.local> <83oa8dau7i.fsf@gnu.org> <8760ul9caj.fsf@gmx.net> <83lh3hapys.fsf@gnu.org> Date: Thu, 12 May 2016 22:41:01 +0200 In-Reply-To: <83lh3hapys.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 11 May 2016 12:44:43 +0300") Message-ID: <87r3d7ko0y.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:qxqzFt8f7d6FrTaDC+6SJdl6eGlwbrHobHEKL+L6hsILjJ0SWF9 5euNeM1rAjs3fv+mth3cqDYABauZg8Vi2dn/vo/60O2VNF13NkNQKrRShMje+3+Pm9Qe3RK c9RMxqgaosWhX7GVwNPGIibbXPU2c+TsWV9mIKRco7msOPk8e7PtHrNpWHtq/DXxlMMl+BF +Og0MAx3uvVMBmlz0uA5Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:1wLlAm2r4qo=:0/3nN9G5oR0bKGi1X0+PQy fgsYijiJS3vzeRiDNTJipk6VSi7BrHSFiqsnbj9tgNmZMkYgCXoTetE/iRXaZifFBiOo2Puci cCeoahT02ofDeJna9w/kboURJV5mHvXqHwhiyNq4SwlcsP9oS5tliEktqItJJQZs+BRQjqanM w5anb8Mwqla9EcnpnLMtTS4Ux3J/NytWo99poOzSB4bYxlttFkTgBB164TNzWPeD8mR8C4KS4 euqSA49hky43AUWfsqASpvMPCgPds+uUdGNEGgBamihaxgx/04APccawRB0HpBHCRLwDiBcwP Yh3lJxpIzfiX6/Or8Z2UdkKB7JZMgDnLyXYKNj5Cuvyuw4SrI+QidNC1E8SIn26W76mwaT5iG DtMBDCdvNIBeR90V0dG8x6R/ntEJM8eYgCQR1pYtHq9BHa7FlhkYZAJzmT+ctVnLuO6kjC15L rVxSQIzKme8V4VSFlNp56ymIc0d95VIai8edC+Lag0CQJHgKACqu7fmdj0x97CyFFipvYKW+r hrZ9Vvd9hJg9rKRKlFhJfG9fHymQEQryuRf8xFzOg0s6uVaWfrdNAnUGtOmIxRfl7CqnFxWQZ GQedbgkCW2TgD9FYm744LCB1m83cBhyYm4nN7aT0MOWzezx9sW6dCcfTlt+qX9rHOJ9TFFhAq mVpsFGcV05tb3pTYYUgC5nZgwWSj2IVuwU6DMnOxk9xB2WY77GUlcf0SX8rwYcZBIg7ywXiZ+ PiHyGDUV4tCMx6mGOilvId9mO2Ujb2RBn3vQNQuxPY1+08b2zHJ6HVDMpCTHVyBTQOacSb6Lc rCFMDsQ/vFWW1YxLLNs2mu/2aWiSQ== X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 23510 Cc: 23510@debbugs.gnu.org, angelo.graziosi@libero.it X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) On Wed, 11 May 2016 12:44:43 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: "angelo.graziosi\@libero.it" , >> 23510@debbugs.gnu.org >> Date: Wed, 11 May 2016 11:25:24 +0200 >> >> What you say about the use of pre- and post-command-hook and moving >> overlays may well be (perhaps the main) part of the problem here, but I >> found out that there's an specific condition inducing it: I noticed that >> the flickering only happens when global-hl-line-mode is enabled, but not >> when hl-line-mode is enabled, and it turns out that the crucial >> difference between them is that in the former, >> global-hl-line-sticky-flag is nil by default, while in the latter, >> hl-line-sticky-flag is t by default: when I set >> global-hl-line-sticky-flag to t and then enable global-hl-line-mode, the >> flickering no longer happens, and when I set hl-line-sticky-flag to nil >> and then enable hl-line-mode, the flickering does happen. > > If you can suggest a patch that fixes that and doesn't have any > adverse effects, please do. Ok, I've given it a try; patch below. Debugging showed that the flickering is caused by calling delete-overlay on pre-command-hook, so I eliminated the uses of this hook and replaced them with the new functions hl-line-maybe-unhighlight and global-hl-line-maybe-unhighlight added to post-command-hook that call delete-overlay under more specific conditions. According to my tests this does not lead to flickering and highlights and unhighlights as before (but others should test the code, in case I missed or messed up anything). I also noticed that the definition of global-hl-line-mode fails to remove global-hl-line-highlight from change-major-mode-hook when the mode is disabled; I assume this was an oversite, so I rectified it. If my fix is found acceptable, I assume it should go to master, since the flickering problem was probably always there, so is not a regression in emacs-25. With that in mind, I took the opportunity to make global-hl-line-mode automatically taken effect in all live windows when global-hl-line-sticky-flag is non-nil (the new function global-hl-line-highlight-all); in the current (and I assume original) implementation, enabling global-hl-line-mode only highlights the current line of the selected window, even when global-hl-line-sticky-flag is non-nil (the highlighting appears in other windows when they become selected). This change seems consistent with the idea of Global-Hl-Line mode, expressed in its doc string ("Toggle line highlighting in all buffers"). I tested it with three windows in each of two frames (the most that comfortably fit on my display), and the highlighting was as fast as with two windows on one frame, but I suppose it's possible that more windows on more frames might be slower. Steve Berman diff --git a/lisp/hl-line.el b/lisp/hl-line.el index 25c8a08..642a8ba 100644 --- a/lisp/hl-line.el +++ b/lisp/hl-line.el @@ -126,6 +126,9 @@ hl-line-range-function This variable is expected to be made buffer-local by modes.") +(defvar hl-line-overlay-buffer nil + "Most recently visited buffer in which Hl-Line mode is enabled.") + ;;;###autoload (define-minor-mode hl-line-mode "Toggle highlighting of the current line (Hl-Line mode). @@ -142,22 +145,21 @@ hl-line-mode When `hl-line-sticky-flag' is nil, Hl-Line mode highlights the line about point in the selected window only. In this case, it -uses the function `hl-line-unhighlight' on `pre-command-hook' in +uses the function `hl-line-maybe-unhighlight' in addition to `hl-line-highlight' on `post-command-hook'." :group 'hl-line (if hl-line-mode (progn ;; In case `kill-all-local-variables' is called. (add-hook 'change-major-mode-hook #'hl-line-unhighlight nil t) - (if hl-line-sticky-flag - (remove-hook 'pre-command-hook #'hl-line-unhighlight t) - (add-hook 'pre-command-hook #'hl-line-unhighlight nil t)) (hl-line-highlight) - (add-hook 'post-command-hook #'hl-line-highlight nil t)) + (setq hl-line-overlay-buffer (current-buffer)) + (add-hook 'post-command-hook #'hl-line-highlight nil t) + (add-hook 'post-command-hook #'hl-line-maybe-unhighlight)) (remove-hook 'post-command-hook #'hl-line-highlight t) (hl-line-unhighlight) (remove-hook 'change-major-mode-hook #'hl-line-unhighlight t) - (remove-hook 'pre-command-hook #'hl-line-unhighlight t))) + (remove-hook 'post-command-hook #'hl-line-maybe-unhighlight t))) (defun hl-line-make-overlay () (let ((ol (make-overlay (point) (point)))) @@ -181,6 +183,22 @@ hl-line-unhighlight (when hl-line-overlay (delete-overlay hl-line-overlay))) +(defun hl-line-maybe-unhighlight () + "Maybe deactivate the Hl-Line overlay on the current line. +Specifically, when `hl-line-sticky-flag' is nil deactivate all +such overlays in all buffers except the current one." + (let ((hlob hl-line-overlay-buffer) + (curbuf (current-buffer))) + (when (and (not hl-line-sticky-flag) + (not (eq curbuf hlob)) + (not (minibufferp))) + (with-current-buffer hlob + (when (overlayp hl-line-overlay) + (delete-overlay hl-line-overlay)))) + (when (and (overlayp hl-line-overlay) + (eq (overlay-buffer hl-line-overlay) curbuf)) + (setq hl-line-overlay-buffer curbuf)))) + ;;;###autoload (define-minor-mode global-hl-line-mode "Toggle line highlighting in all buffers (Global Hl-Line mode). @@ -189,25 +207,24 @@ global-hl-line-mode the mode if ARG is omitted or nil. If `global-hl-line-sticky-flag' is non-nil, Global Hl-Line mode -highlights the line about the current buffer's point in all +highlights the line about the current buffer's point in all live windows. -Global-Hl-Line mode uses the functions `global-hl-line-unhighlight' and -`global-hl-line-highlight' on `pre-command-hook' and `post-command-hook'." +Global-Hl-Line mode uses the functions `global-hl-line-highlight' +and `global-hl-line-maybe-unhighlight' on `post-command-hook'." :global t :group 'hl-line (if global-hl-line-mode (progn ;; In case `kill-all-local-variables' is called. (add-hook 'change-major-mode-hook #'global-hl-line-unhighlight) - (if global-hl-line-sticky-flag - (remove-hook 'pre-command-hook #'global-hl-line-unhighlight) - (add-hook 'pre-command-hook #'global-hl-line-unhighlight)) - (global-hl-line-highlight) - (add-hook 'post-command-hook #'global-hl-line-highlight)) + (global-hl-line-highlight-all) + (add-hook 'post-command-hook #'global-hl-line-highlight) + (add-hook 'post-command-hook #'global-hl-line-maybe-unhighlight)) (global-hl-line-unhighlight-all) - (remove-hook 'pre-command-hook #'global-hl-line-unhighlight) - (remove-hook 'post-command-hook #'global-hl-line-highlight))) + (remove-hook 'post-command-hook #'global-hl-line-highlight) + (remove-hook 'change-major-mode-hook #'global-hl-line-unhighlight) + (remove-hook 'post-command-hook #'global-hl-line-maybe-unhighlight))) (defun global-hl-line-highlight () "Highlight the current line in the current window." @@ -222,11 +239,33 @@ global-hl-line-highlight (selected-window))) (hl-line-move global-hl-line-overlay)))) +(defun global-hl-line-highlight-all () + "Highlight the current line in all live windows." + (walk-windows (lambda (w) + (with-current-buffer (window-buffer w) + (global-hl-line-highlight))) + nil t)) + (defun global-hl-line-unhighlight () "Deactivate the Global-Hl-Line overlay on the current line." (when global-hl-line-overlay (delete-overlay global-hl-line-overlay))) +(defun global-hl-line-maybe-unhighlight () + "Maybe deactivate the Global-Hl-Line overlay on the current line. +Specifically, when `global-hl-line-sticky-flag' is nil deactivate +all such overlays in all buffers except the current one." + (mapc (lambda (ov) + (let ((ovb (overlay-buffer ov))) + (when (and (not global-hl-line-sticky-flag) + (bufferp ovb) + (not (eq ovb (current-buffer))) + (not (minibufferp))) + (with-current-buffer ovb + (when (overlayp global-hl-line-overlay) + (delete-overlay global-hl-line-overlay)))))) + global-hl-line-overlays)) + (defun global-hl-line-unhighlight-all () "Deactivate all Global-Hl-Line overlays." (mapc (lambda (ov) From debbugs-submit-bounces@debbugs.gnu.org Mon May 16 15:16:21 2016 Received: (at 23510) by debbugs.gnu.org; 16 May 2016 19:16:21 +0000 Received: from localhost ([127.0.0.1]:54378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2O05-0008R0-92 for submit@debbugs.gnu.org; Mon, 16 May 2016 15:16:21 -0400 Received: from mout.gmx.net ([212.227.15.18]:62340) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2O04-0008Qn-5Q for 23510@debbugs.gnu.org; Mon, 16 May 2016 15:16:20 -0400 Received: from rosalinde ([89.245.95.252]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MI4yc-1b1plX1Wlq-003sQV; Fri, 13 May 2016 19:52:57 +0200 From: Stephen Berman To: Eli Zaretskii Subject: Re: bug#23510: Strange redisplay in global highlighted mode moving the scroll bar References: <1959517970.14624161462908686797.JavaMail.httpd@webmail-60.iol.local> <83oa8dau7i.fsf@gnu.org> <8760ul9caj.fsf@gmx.net> <83lh3hapys.fsf@gnu.org> Date: Fri, 13 May 2016 19:52:56 +0200 In-Reply-To: <83lh3hapys.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 11 May 2016 12:44:43 +0300") Message-ID: <87bn49u9on.fsf@rub.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:aDqh+rUXw6tERoHLoJ7zP9dJxGx4bLvfDgZvhY40Sz6bj4ZhHng pyCWfRYJTIwjdtcDHuOyS9k5cXr2WrrwuWCHW+hn+vvDbtnyoohjYmDnusXdeSnlQcxgOW0 jbWJXjlGW2j6upZKMxDA32JI3pL8Do2Kzcqjf/fEeX8aRgWJlc2BkkZH7HYNWmWkWvuaNGk 8HFi0Lui+P9v2pK5agttg== X-UI-Out-Filterresults: notjunk:1;V01:K0:ocITFoCmxqo=:nmbbPXDWVEPVaZVAhXEAxz GM9adqeSKmIXcU5jVg6F8uV1EuQ6gLMMhrkOx3clLbuFvw569wUyzYUU+g73+m90eGGuhmm4b EiiUDrc/2tV+zqKx15slwXvMFzKd4b6349jUS0TynwYwSa1OJhWSsWnFoF7Rglvg8lpQ6M5wY jZLrp680lOTiIffkZaTdoadxafmkA2o3nWC0yZtmTXLVjoBK+l87fNpCtARfxlHGTGPUdjhfY 3g25WaDSFh1PV0DBUxwOlsmRhch3/NTeJgIjH2IEA0BdfOAT1lDe5vW7nMSkLeScSW1xT6cgK DOYe9WCigA5/jdTPL2VrplsoADGHV2vybX/24szdBm3h4/UGLBmxSwDsB8vC0RMlGGsXh6FPe NFo5I44/m0UHCvrJOrbdL2FiafCEGiJMZr16OggVL/H1vjqoLH1Ay5PpXz/r2GDx9TeB9J7qX JUEtOTLqy9r7nPvZqtDar6CLdbNmRCHST9BZLwfsNV6yaRRIfEvY6HT1PF1vKd4GXWuONgpQE GAaxG5BGEJxYe01Sbyy+IBGxiyC2E5JpbWuh5CgRdQqOInZA+aDxh26KQVCVtkVSssUqsYED1 TTR5lSO0FYgmDQEhZf65ZORgnugUmPMTtI0/RCjjJ3MIN747AjQ8OjNWuo1Oj7sjcpk4GV5+Z eN/L1FgS08bcWlW1Ho+SPAuhY1aipNlcPX1qOz2IEU9rmzI8VJHnfwfUPUMl3qQuRj52HdQke A8gv0tMk7k7V23BW0quEe/NzK3N9Wa615NUnmSuO9P2kwSTt2rF6yYEov4VN17axynErZ3+pG cWqYDRk X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 23510 Cc: 23510@debbugs.gnu.org, Stephen Berman , angelo.graziosi@libero.it X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) On Wed, 11 May 2016 12:44:43 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: "angelo.graziosi\@libero.it" , >> 23510@debbugs.gnu.org >> Date: Wed, 11 May 2016 11:25:24 +0200 >> >> What you say about the use of pre- and post-command-hook and moving >> overlays may well be (perhaps the main) part of the problem here, but I >> found out that there's an specific condition inducing it: I noticed that >> the flickering only happens when global-hl-line-mode is enabled, but not >> when hl-line-mode is enabled, and it turns out that the crucial >> difference between them is that in the former, >> global-hl-line-sticky-flag is nil by default, while in the latter, >> hl-line-sticky-flag is t by default: when I set >> global-hl-line-sticky-flag to t and then enable global-hl-line-mode, the >> flickering no longer happens, and when I set hl-line-sticky-flag to nil >> and then enable hl-line-mode, the flickering does happen. > > If you can suggest a patch that fixes that and doesn't have any > adverse effects, please do. I have a patch, which I sent last night but it never arrived; I resent it twice today, once from the same email address and once from a different one, but neither of those have arrived, although other posts have appeared in the list since my attempts were sent. So this is just a test to see if I can get through at all; if so, I'll try to see if I can send the patch another way. Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Mon May 16 17:33:32 2016 Received: (at 23510) by debbugs.gnu.org; 16 May 2016 21:33:32 +0000 Received: from localhost ([127.0.0.1]:54473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2Q8q-0005Gl-5j for submit@debbugs.gnu.org; Mon, 16 May 2016 17:33:32 -0400 Received: from mout.gmx.net ([212.227.15.15]:51336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2Q8n-0005GV-O5 for 23510@debbugs.gnu.org; Mon, 16 May 2016 17:33:30 -0400 Received: from rosalinde ([89.245.97.238]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0M2tXS-1btyGS34v0-00sg1Z; Mon, 16 May 2016 23:33:22 +0200 From: Stephen Berman To: Angelo Graziosi Subject: Re: Strange redisplay in global highlighted mode moving the scroll bar References: <583a66be-763b-1a75-45be-b892eeacb48e@alice.it> Date: Mon, 16 May 2016 23:33:01 +0200 In-Reply-To: <583a66be-763b-1a75-45be-b892eeacb48e@alice.it> (Angelo Graziosi's message of "Sat, 14 May 2016 09:42:13 +0200") Message-ID: <87shxhbsdu.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:TlOZTz8t/lI4OycvhA/rfCGT6LU84/YLTII4UNQfyptYcsycFhk 4LdCjRlGH2yYrZj4h2r5jzLia+Iize9FHWFElh7h6qPyc6EjSikAkMPXTonftZbwzi86IGy cpztDECru4RAc8dQPadEuOLsfjrAaWo/dNwotatek7GN+1tGYu7qlCqvICxw6IH/thHnazW bEKPQYdjlqHb6zUNaGYrw== X-UI-Out-Filterresults: notjunk:1;V01:K0:fCZpAqf9KsI=:65ieu98Z0MXRvrTg8U5f9v 2Fg1Tk67obCTmSshLvkpSngMbyVtxJVof1aGm3Rl7P9DKZZ2P2bng16AFSv3GhwfLSJ55YuXD uDcxvBOYebFT/0r5lrxj0KYHULy7ODlOn+UwTJJMvSTQRe5durnutLbo9HohKJKCcy67dG7gI YyHo5YMSLsfum08s+uJm2JTWZF4dWF+I3+kwen1BoGiZgmDUe/YkvqQT2jI9KMNnka3k89T9C PpnLB9pDrrO1lxwjp6W1n85/1dWmpGjxW+YHmRBhaTCe3SRYI0XpCCkHCeGqsordRiBHZrwJQ 3ziGmwBS5/Aa5RUx2kmiifFJ/YZVrARPaW4V/Njswj2tocQM+q0snGU/Q5p7a7MN7VKfxtNoV htE8HfNAC0+xpKA6N03utoX8Vg9OGt1QbZfD0TMEYEHJPTq2+fKKv3SyUQ+pmJvOqXTqByroP /D/xRGOSPpudy4t9u4XyJgw4IgN1OAheJjTV9scdc88IfQyM+L7r1bOMCLHPANnVV9lCVYsxf iK+OKh3oiLPHZKvgEbf1BFMH7rIbZtZ+HAaxeX5LghyxwbDwFokfzaQF+mEr70ACTVpoI04eh /sBTZWuAXlMjp/qt7+SKV3t6S63qlkE8i+lce2okWsqakDvSHNO4tLHGmh/c6xXTPm7jfJH4Y mrYcVrFR6bT2goEa5IsDcCPQ0ZyMNIbHF7R6u0Fi30+aJRMveRiHB2FMLlTLznBwoPtInO4RZ VpQIloyYG98clVSgby1oBIsNNfD5fdgS+rVkAjvTV6EeePq4SIVPNoLOv0h7a4U1Ok1ClcE+G 7b1INoI4J3/xEgPjtiZAlsRIM5KYQ== X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 23510 Cc: 23510@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) On Sat, 14 May 2016 09:42:13 +0200 Angelo Graziosi wrote: >> If my fix is found acceptable > > I have tested the patch with this init.el file: > > ;; > (global-hl-line-mode 1) > > > and it seems to work.. I take it you mean you see no flickering? That would confirm the patch fixes problem you reported. You should also see, when you make the frame have two (or more) windows, that the current line of only the selected window is highlighted; this is the default behavior without the patch and should obtain with the patch as well. > Any other configuration for testing? The default for global-hl-line-mode, which you tested with the above, is for the value of global-hl-line-sticky-flag to be nil; if you set it to non-nil, then when you make the frame display two (or more) windows, the current line is highlighted in all of them. A difference between the behavior of the existing version of hl-line.el and the behavior with my patch is that, in the former, the current line of each window displaying a different buffer becomes highlighted only as soon as that window is selected (and remains highlighted when another window is selected), while with my patch, the current line in all live (visible) windows is highlighted at once. So this is a new feature and the question is, do you prefer this behavior to the original behavior? (If all the windows display the same buffer, then with non-nil global-hl-line-sticky-flag the highlighting appears in all of them simultaneously both with and without the patch.) It would be helpful if you'd also test the behavior of the patch with the buffer local hl-line-mode. Here, the default is for the value of hl-line-sticky-flag to be non-nil, which means that if the same buffer is displayed in two (or more) windows of a frame, the current line is highlighted in each of these windows, and in addtion, when you select a window displaying a different buffer, the line in the previously selected window (displaying the buffer in which hl-line-mode was enabled) remains highlighted. If you set hl-line-sticky-flag to nil, then only the current line of the selected window is highlighted. These behaviors of hl-line-mode should still be the same with the patch. But without the patch, setting hl-line-sticky-flag to nil results in flickering of the highlighted line when moving the scroll bar with the mouse; with the patch, there should be no flickering. Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Mon May 16 18:29:09 2016 Received: (at 23510) by debbugs.gnu.org; 16 May 2016 22:29:09 +0000 Received: from localhost ([127.0.0.1]:54518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2R0f-0006Yn-0W for submit@debbugs.gnu.org; Mon, 16 May 2016 18:29:09 -0400 Received: from smtp204.alice.it ([82.57.200.100]:33476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2R0b-0006YH-KK for 23510@debbugs.gnu.org; Mon, 16 May 2016 18:29:07 -0400 Received: from [192.168.1.103] (95.246.229.228) by smtp204.alice.it (8.6.060.43) (authenticated as angelo.graziosi@alice.it) id 571880A504B02F50; Tue, 17 May 2016 00:28:56 +0200 Subject: Re: Strange redisplay in global highlighted mode moving the scroll bar To: Stephen Berman References: <583a66be-763b-1a75-45be-b892eeacb48e@alice.it> <87shxhbsdu.fsf@gmx.net> From: Angelo Graziosi Message-ID: Date: Tue, 17 May 2016 00:28:57 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <87shxhbsdu.fsf@gmx.net> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Stephen, I tried your patch without an init file and calling "M-x hl-line-mode" and then "M-x global-hl-line-mode" and I think I can reproduce all your arguments below. Now my init file contains [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.7 RCVD_IN_PSBL RBL: Received via a relay in PSBL [82.57.200.100 listed in psbl.surriel.com] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [82.57.200.100 listed in wl.mailspike.net] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (angelo.graziosi[at]alice.it) -1.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Debbugs-Envelope-To: 23510 Cc: 23510@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Stephen, I tried your patch without an init file and calling "M-x hl-line-mode" and then "M-x global-hl-line-mode" and I think I can reproduce all your arguments below. Now my init file contains [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.7 RCVD_IN_PSBL RBL: Received via a relay in PSBL [82.57.200.100 listed in psbl.surriel.com] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [82.57.200.100 listed in wl.mailspike.net] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (angelo.graziosi[at]alice.it) -1.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Stephen, I tried your patch without an init file and calling "M-x hl-line-mode" and then "M-x global-hl-line-mode" and I think I can reproduce all your arguments below. Now my init file contains (setq global-hl-line-sticky-flag t) (global-hl-line-mode 1) so that I can see the line in all windows of the frame. Obviously, no flickering in all case you describe below.. Angelo Il 16/05/2016 23:33, Stephen Berman ha scritto: > On Sat, 14 May 2016 09:42:13 +0200 Angelo Graziosi wrote: > >>> If my fix is found acceptable >> >> I have tested the patch with this init.el file: >> >> ;; >> (global-hl-line-mode 1) >> >> >> and it seems to work.. > > I take it you mean you see no flickering? That would confirm the patch > fixes problem you reported. You should also see, when you make the > frame have two (or more) windows, that the current line of only the > selected window is highlighted; this is the default behavior without the > patch and should obtain with the patch as well. > >> Any other configuration for testing? > > The default for global-hl-line-mode, which you tested with the above, is > for the value of global-hl-line-sticky-flag to be nil; if you set it to > non-nil, then when you make the frame display two (or more) windows, the > current line is highlighted in all of them. A difference between the > behavior of the existing version of hl-line.el and the behavior with my > patch is that, in the former, the current line of each window displaying > a different buffer becomes highlighted only as soon as that window is > selected (and remains highlighted when another window is selected), > while with my patch, the current line in all live (visible) windows is > highlighted at once. So this is a new feature and the question is, do > you prefer this behavior to the original behavior? (If all the windows > display the same buffer, then with non-nil global-hl-line-sticky-flag > the highlighting appears in all of them simultaneously both with and > without the patch.) > > It would be helpful if you'd also test the behavior of the patch with > the buffer local hl-line-mode. Here, the default is for the value of > hl-line-sticky-flag to be non-nil, which means that if the same buffer > is displayed in two (or more) windows of a frame, the current line is > highlighted in each of these windows, and in addtion, when you select a > window displaying a different buffer, the line in the previously > selected window (displaying the buffer in which hl-line-mode was > enabled) remains highlighted. If you set hl-line-sticky-flag to nil, > then only the current line of the selected window is highlighted. These > behaviors of hl-line-mode should still be the same with the patch. But > without the patch, setting hl-line-sticky-flag to nil results in > flickering of the highlighted line when moving the scroll bar with the > mouse; with the patch, there should be no flickering. > > Steve Berman > From debbugs-submit-bounces@debbugs.gnu.org Wed May 25 18:13:39 2016 Received: (at 23510) by debbugs.gnu.org; 25 May 2016 22:13:39 +0000 Received: from localhost ([127.0.0.1]:38815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5h3a-0003zB-QF for submit@debbugs.gnu.org; Wed, 25 May 2016 18:13:39 -0400 Received: from smtp204.alice.it ([82.57.200.100]:51888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5h3Y-0003yv-BO for 23510@debbugs.gnu.org; Wed, 25 May 2016 18:13:37 -0400 Received: from [192.168.1.101] (79.13.228.33) by smtp204.alice.it (8.6.060.43) (authenticated as angelo.graziosi@alice.it) id 57443227005F2F70; Thu, 26 May 2016 00:13:26 +0200 Subject: Re: Strange redisplay in global highlighted mode moving the scroll bar To: Stephen Berman References: <583a66be-763b-1a75-45be-b892eeacb48e@alice.it> <87shxhbsdu.fsf@gmx.net> From: Angelo Graziosi Message-ID: Date: Thu, 26 May 2016 00:13:28 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 23510 Cc: 23510@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) Any news about this issue? I am still using an Emacs build with Stephen's patch and I see no problem... Angelo Il 17/05/2016 00:28, Angelo Graziosi ha scritto: > Stephen, > > I tried your patch without an init file and calling "M-x hl-line-mode" > and then "M-x global-hl-line-mode" and I think I can reproduce all your > arguments below. > > Now my init file contains > > (setq global-hl-line-sticky-flag t) > (global-hl-line-mode 1) > > so that I can see the line in all windows of the frame. > > Obviously, no flickering in all case you describe below.. > > > Angelo > > Il 16/05/2016 23:33, Stephen Berman ha scritto: >> On Sat, 14 May 2016 09:42:13 +0200 Angelo Graziosi >> wrote: >> >>>> If my fix is found acceptable >>> >>> I have tested the patch with this init.el file: >>> >>> ;; >>> (global-hl-line-mode 1) >>> >>> >>> and it seems to work.. >> >> I take it you mean you see no flickering? That would confirm the patch >> fixes problem you reported. You should also see, when you make the >> frame have two (or more) windows, that the current line of only the >> selected window is highlighted; this is the default behavior without the >> patch and should obtain with the patch as well. >> >>> Any other configuration for testing? >> >> The default for global-hl-line-mode, which you tested with the above, is >> for the value of global-hl-line-sticky-flag to be nil; if you set it to >> non-nil, then when you make the frame display two (or more) windows, the >> current line is highlighted in all of them. A difference between the >> behavior of the existing version of hl-line.el and the behavior with my >> patch is that, in the former, the current line of each window displaying >> a different buffer becomes highlighted only as soon as that window is >> selected (and remains highlighted when another window is selected), >> while with my patch, the current line in all live (visible) windows is >> highlighted at once. So this is a new feature and the question is, do >> you prefer this behavior to the original behavior? (If all the windows >> display the same buffer, then with non-nil global-hl-line-sticky-flag >> the highlighting appears in all of them simultaneously both with and >> without the patch.) >> >> It would be helpful if you'd also test the behavior of the patch with >> the buffer local hl-line-mode. Here, the default is for the value of >> hl-line-sticky-flag to be non-nil, which means that if the same buffer >> is displayed in two (or more) windows of a frame, the current line is >> highlighted in each of these windows, and in addtion, when you select a >> window displaying a different buffer, the line in the previously >> selected window (displaying the buffer in which hl-line-mode was >> enabled) remains highlighted. If you set hl-line-sticky-flag to nil, >> then only the current line of the selected window is highlighted. These >> behaviors of hl-line-mode should still be the same with the patch. But >> without the patch, setting hl-line-sticky-flag to nil results in >> flickering of the highlighted line when moving the scroll bar with the >> mouse; with the patch, there should be no flickering. >> >> Steve Berman >> From debbugs-submit-bounces@debbugs.gnu.org Wed May 25 22:44:55 2016 Received: (at 23510) by debbugs.gnu.org; 26 May 2016 02:44:55 +0000 Received: from localhost ([127.0.0.1]:39147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5lI6-0002F9-Pd for submit@debbugs.gnu.org; Wed, 25 May 2016 22:44:55 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43007) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5lI5-0002Ew-9D for 23510@debbugs.gnu.org; Wed, 25 May 2016 22:44:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5lHv-0007Vf-EM for 23510@debbugs.gnu.org; Wed, 25 May 2016 22:44:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5lHv-0007VC-Ar; Wed, 25 May 2016 22:44:43 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2054 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1b5lHu-00086Q-KH; Wed, 25 May 2016 22:44:42 -0400 Date: Thu, 26 May 2016 05:44:48 +0300 Message-Id: <83mvnd35cv.fsf@gnu.org> From: Eli Zaretskii To: Angelo Graziosi In-reply-to: (message from Angelo Graziosi on Thu, 26 May 2016 00:13:28 +0200) Subject: Re: Strange redisplay in global highlighted mode moving the scroll bar References: <583a66be-763b-1a75-45be-b892eeacb48e@alice.it> <87shxhbsdu.fsf@gmx.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: 23510 Cc: 23510@debbugs.gnu.org, stephen.berman@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.4 (------) > Cc: 23510@debbugs.gnu.org, Eli Zaretskii > From: Angelo Graziosi > Date: Thu, 26 May 2016 00:13:28 +0200 > > Any news about this issue? I am still using an Emacs build with > Stephen's patch and I see no problem... Would someone please install that? From debbugs-submit-bounces@debbugs.gnu.org Thu May 26 05:35:10 2016 Received: (at 23510-done) by debbugs.gnu.org; 26 May 2016 09:35:10 +0000 Received: from localhost ([127.0.0.1]:39256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5rh7-0003Xj-OW for submit@debbugs.gnu.org; Thu, 26 May 2016 05:35:09 -0400 Received: from mout.gmx.net ([212.227.15.19]:63310) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5rh6-0003XW-EU for 23510-done@debbugs.gnu.org; Thu, 26 May 2016 05:35:09 -0400 Received: from rosalinde ([89.245.79.221]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0LpsIh-1bhy832rih-00fghG; Thu, 26 May 2016 11:34:36 +0200 From: Stephen Berman To: Eli Zaretskii Subject: Re: Strange redisplay in global highlighted mode moving the scroll bar References: <583a66be-763b-1a75-45be-b892eeacb48e@alice.it> <87shxhbsdu.fsf@gmx.net> <83mvnd35cv.fsf@gnu.org> Date: Thu, 26 May 2016 11:34:34 +0200 In-Reply-To: <83mvnd35cv.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 26 May 2016 05:44:48 +0300") Message-ID: <87eg8pnowl.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:3FyC/Zx7I6qE4ryygPYa9vY+C0aPWD+IGnxBPpy+Gh4BwGflZut z0Vjr46/AbhBnInL1XWVc2r8t55cNBC9/5L7NCX64co5KPYZWgmUjP9cnJ4MKNZBTb7r4M0 mtiYU2tjzV+j5Erit6X2+wlx9hahKJCqAO4RwgZvBhQiCasGKe9SrI2rNerhPbZjArDONCy 9ik0yHHz8Q/vDMDJ2u5fQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:Sq+86k4ZQQA=:UoZlqtIn5DrjZknLlxjJek yGT4FfKeCCrZqPRFDeZmoh0M1i8OMSnIhwqtny2hByyXJpFHrHXM6r441nB0hzntkAVHoeRBw b1Ucp7ewQS4USEL0O6XJAwOa7CeqSy+7lPeqKmqxedl6xcqea0S0zeOZIQA/q8vSBhUP47c8F cLQinzUxflY4SqWlXM+C+S3CF0XM1BCc8RCmsqsO2lBgT50qONSeLkFPojr6YX98TLQHpi6oF Iod0g1nMYMZMi9d6D4yn2gaojPfDyD6pGIpzwHfACYX0mqBeQZObC8utXSce839xCK1EAa7TI PYB85jpo0q087L3KVRHcmuWmyOEauUntGLyUSOb7neoeCruVBhUWFFdMF95Ilmy0dgUsmApK+ 7Lz+se/R1SJbTNCRXVTyZklaNUEZZIy3A1w8Z+Z+8pkV6/ZArHEaY63PDmNPu5H/zvcObGhZP P5+Ilig/CLx3gu1kC3XWsjU+eKPFJdl4rfA0zHdsiLvQdFJ/UUnlMhvbjWCvxuXGxu5KAJ7Qp 8IU0MQpwuq61NMEIbXfoCajdmmBUXl01yYkq2ZibD7BeCvlkZhk48p34Gk7alH8zSNqHAyJk3 U3B8tMDFrdcDircLvCkjDoGwcc7qSSeI1SNPewb7olYiXaWUYhYvqYNDoNKT6RG4XByil4tb6 83KwnqrpiujG4xrh9W/dYUr883Q7KeyUwxjclXtRQrMkggzqYInLU58/BYHfo/CMQTK8n1p6g ItZGD1QHA5UOnSH1kQxpfAklGUsYz6R+ttDuEof6SgqlxrmhTNB8ecri5a80u91bfYsyr0idk nJC/Hv4 X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 23510-done Cc: 23510-done@debbugs.gnu.org, Angelo Graziosi X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) On Thu, 26 May 2016 05:44:48 +0300 Eli Zaretskii wrote: >> Cc: 23510@debbugs.gnu.org, Eli Zaretskii >> From: Angelo Graziosi >> Date: Thu, 26 May 2016 00:13:28 +0200 >> >> Any news about this issue? I am still using an Emacs build with >> Stephen's patch and I see no problem... > > Would someone please install that? Done in commit 16be3e90545972dec16014253a843229d5bdf388 to master and closing the bug. Steve Berman From unknown Fri Jun 20 07:08:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 23 Jun 2016 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator