GNU bug report logs - #64993
29.1; scroll-other-window breaks global-hl-line-sticky-flag

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Tue, 1 Aug 2023 15:00:02 UTC

Severity: wishlist

Found in version 29.1

Full log


View this message in rfc822 format

From: Spencer Baugh <sbaugh <at> janestreet.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64993 <at> debbugs.gnu.org
Subject: bug#64993: 29.1; scroll-other-window breaks global-hl-line-sticky-flag
Date: Tue, 01 Aug 2023 13:13:36 -0400
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 12:28:14 -0400
>> 
>> 1. emacs -Q
>> 2. Eval
>> (setq global-hl-line-sticky-flag t)
>> (global-hl-line-mode)
>> 3. C-x 3  (make two windows)
>> 4. C-h n  (make one window contain NEWS)
>> 5. C-x o  (switch to the other window)
>> 6. Note the line with point is highlighted in both windows
>> 6. scroll-other-window
>> 7. Note the line with point is no longer highlighted in the NEWS window
>
> And why is this a bug?

Because it contradicts the docstring and the intent of the flag, which
is to have a highlight for point in all windows.

> 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.

> 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.




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.