Subject: bug#64993: 29.1; scroll-other-window breaks global-hl-line-sticky-flag

From: Spencer Baugh <[email-masked]>
Date: Tue, 01 Aug 2023 12:28:14 -0400

Eli Zaretskii <[email-masked]> writes:
> tags 64993 notabug
> thanks
>
>> From: Spencer Baugh <[email-masked]>
>> Date: Tue, 01 Aug 2023 10:59:29 -0400
>> 
>> 
>> 1. emacs -Q
>> 2. Eval
>> (setq global-hl-line-sticky-flag t)
>> (global-hl-line-mode)
>> 3. C-h n  (to open up a buffer with lots of text for scrolling)
>> 4. C-x 3
>> 5. 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 other window
>
> That's a feature, and you activated it by setting
> global-hl-line-sticky-flag:
>
>   (defcustom global-hl-line-sticky-flag nil
>     "Non-nil means the Global HL-Line mode highlight appears in all windows.
>
>   (define-minor-mode global-hl-line-mode
>     "Toggle line highlighting in all buffers (Global Hl-Line mode).
>
>   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.
>
> So what you describe as "the line with point is no longer highlighted
> in the other window" actually happens before the point in the selected
> window is no longer visible in the other window, and thus neither is
> the highlighted line.
>
> This is not a bug.

Oops, sorry, my reproduction was confusing, I made an error in having
both windows contain the same buffer.  They should obviously contain
different buffers otherwise your response is correct.

Try again with:

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