Subject: bug#36283: 27.0.50; hl-line-mode updates the wrong window after clone-indirect-buffer

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 01 Feb 2021 10:31:42 +0100

Noam Postavsky <[email-masked]> writes:

> Matthew Newton <[email-masked]> writes:
>
>> In GUI Emacs on MacOS:
>>
>> emacs -Q
>> M-x hl-line-mode
>> C-p
>> M-x clone-indirect-buffer
>> C-p
>>
>> The highlighted line moves in the inactive window and does not move
>> in the active window.
>>
>> I tested this on Emacs 24.5 from https://emacsformacosx.com/ so it
>> doesn’t appear to be recent or specific to my build.
>>
>> Note that if global-hl-line-mode is active, it works as expected,
>> highlighting the line in the active window.
>
> I guess hl-line-mode needs to add an entry to clone-indirect-buffer-hook
> (and clone-buffer-hook; clone-buffer seems to have the same problem)
> to handle copying of hl-line-overlay.

I'm not sure it's a bug, though?  `hl-line-mode' switches on
highlighting in one specific buffer.  An indirect buffer is a new
buffer, and if you want line highlighting there, you should switch it on
there, I think?  Automatically switching on the mode in the indirect
buffer would be surprising, I think.

So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no