From: Spencer Baugh <sbaugh@janestreet.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 64993@debbugs.gnu.org
Subject: bug#64993: 29.1; scroll-other-window breaks global-hl-line-sticky-flag
Date: Tue, 01 Aug 2023 13:32:55 -0400 [thread overview]
Message-ID: <ierjzueacs8.fsf@janestreet.com> (raw)
In-Reply-To: <83a5va1xxj.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 01 Aug 2023 20:20:56 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Spencer Baugh <sbaugh@janestreet.com>
>> Cc: 64993@debbugs.gnu.org
>> Date: Tue, 01 Aug 2023 13:13:36 -0400
>>
>> Eli Zaretskii <eliz@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.
next prev parent reply other threads:[~2023-08-01 17:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 14:59 bug#64993: 29.1; scroll-other-window breaks global-hl-line-sticky-flag Spencer Baugh
2023-08-01 15:54 ` Eli Zaretskii
2023-08-01 16:28 ` Spencer Baugh
2023-08-01 16:57 ` Eli Zaretskii
2023-08-01 17:13 ` Spencer Baugh
2023-08-01 17:20 ` Eli Zaretskii
2023-08-01 17:32 ` Spencer Baugh [this message]
2023-08-01 17:39 ` Eli Zaretskii
2023-08-01 17:46 ` Spencer Baugh
2023-08-01 18:04 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ierjzueacs8.fsf@janestreet.com \
--to=sbaugh@janestreet.com \
--cc=64993@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).