GNU bug report logs -
#64993
29.1; scroll-other-window breaks global-hl-line-sticky-flag
Previous Next
Full log
View this message in rfc822 format
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Spencer Baugh <sbaugh <at> janestreet.com>
>> Cc: 64993 <at> debbugs.gnu.org
>> Date: Tue, 01 Aug 2023 13:13:36 -0400
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> > global-hl-line-sticky-flag non-nil means the
>> > highlight in non-selected windows is not removed:
>> > (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."
>> >
>> > So "C-x o" leaves the highlighting overlay in the window that was
>> > selected, and it will remain at the same position until that window
>> > becomes selected again, because highlighting is moved only in the
>> > selected window.
>>
>> Yes, this is the implementation, and you have explained how it is buggy.
>
> You may think it's "buggy", but the doc string describes the "buggy"
> behavior ("deactivate the overlays in all buffers except the current
> one only if the flag is nil"). So it's at least documented, and one
> could argue that this is the intended behavior.
global-hl-line-maybe-unhighlight is an internal function of
global-hl-line-mode anyway, why and how would a user ever look at its
docstring?
They'd be more likely to look at global-hl-line-mode's docstring, which
explicitly says:
If ‘global-hl-line-sticky-flag’ is non-nil, Global Hl-Line mode
highlights the line about the current buffer’s point in all live
windows.
It says nothing about "but if point moves in a non-current buffer, the
highlighting stops working".
Arguing about this is rather pointless since I assume you would accept a
patch which fixes the behavior to work even if point moves in a
non-current buffer. I just want to remove the notabug marker on this
bug, and I'll get to it eventually, maybe.
>
>> > If you don't like these effects of global-hl-line-sticky-flag, then
>> > don't use it. It's off by default, presumably due to these effects.
>>
>> Things which are off by default can still be buggy.
>
> They can, yes.
This bug report was last modified 1 year and 158 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.