From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#37848: 27.0.50; hl-line and line-numbers out of sync Date: Mon, 21 Oct 2019 15:58:59 +0300 Message-ID: <83lfte2r1o.fsf@gnu.org> References: <83wocy2yjo.fsf@gnu.org> <83tv822x14.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="29088"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37848@debbugs.gnu.org To: Andrey Orst Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 21 15:04:10 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iMXM2-0007Ld-2J for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Oct 2019 15:04:10 +0200 Original-Received: from localhost ([::1]:40696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMXM0-000631-MI for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Oct 2019 09:04:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32998) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMXI7-0002xw-S9 for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2019 09:00:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMXI2-0007NX-Vs for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2019 09:00:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47103) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iMXI2-0007LU-J0 for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2019 09:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iMXI2-00055y-Dg for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2019 09:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Oct 2019 13:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37848 X-GNU-PR-Package: emacs Original-Received: via spool by 37848-submit@debbugs.gnu.org id=B37848.157166275819506 (code B ref 37848); Mon, 21 Oct 2019 13:00:02 +0000 Original-Received: (at 37848) by debbugs.gnu.org; 21 Oct 2019 12:59:18 +0000 Original-Received: from localhost ([127.0.0.1]:55924 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMXHK-00054X-0B for submit@debbugs.gnu.org; Mon, 21 Oct 2019 08:59:18 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMXHI-00054K-2N for 37848@debbugs.gnu.org; Mon, 21 Oct 2019 08:59:16 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:36962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iMXH9-0007A4-8E; Mon, 21 Oct 2019 08:59:09 -0400 Original-Received: from [176.228.60.248] (port=3754 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iMXH7-0003m7-Gz; Mon, 21 Oct 2019 08:59:06 -0400 In-reply-to: (message from Andrey Orst on Mon, 21 Oct 2019 14:38:10 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:169905 Archived-At: [Please keep the bug address on the CC list.] > From: Andrey Orst > Date: Mon, 21 Oct 2019 14:38:10 +0300 > > > It's a bug in hl-line that needs to be fixed. > > > > The display engine runs pre-redisplay-function for the window in this > > case, so perhaps hl-line could install its hook there and fix its > > overlay when it is called. > > > > Patches are welcome. > > Unfortunately adding these hooks doesn't fix issue: > > (add-hook 'pre-redisplay-function #'hl-line-highlight nil t) > (add-hook 'pre-redisplay-function #'hl-line-maybe-unhighlight nil t) > (add-hook 'pre-redisplay-function #'global-hl-line-highlight) > (add-hook 'pre-redisplay-function #'global-hl-line-maybe-unhighlight) This is not as simple as this; pre-redisplay-function is called with an argument, a list of windows that are to be redisplayed (in this case I expect to see only one window in the list). The function should move the overlay in that window using that window's point position. By contrast, the functions you tried don't accept any arguments, and hl-line-highlight assumes that it is called in the selected window. Thanks.