unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Mohsin Kaleem <mohkale@kisara.moe>, 71282-done@debbugs.gnu.org
Subject: bug#71282: 30.0.50; hl-line overlay priority has no affect
Date: Sat, 29 Jun 2024 23:10:34 -0700	[thread overview]
Message-ID: <CADwFkmmyB9UK+4RjibbM+FbtfsqesYmWnZaCi8OYsdU1Xmb-Yw@mail.gmail.com> (raw)
In-Reply-To: <8634pyr0w8.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 31 May 2024 08:44:23 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

> tags 71282 notabug
> thanks
>
>> From: Mohsin Kaleem <mohkale@kisara.moe>
>> Date: Thu, 30 May 2024 23:27:02 +0100
>>
>> Looks like there's no way to give hl-line a higher priority than other
>> text overlays.
>
> Of course there is: use the hl-line-overlay-priority option, like you
> did below.  But the problem you are trying to solve cannot be solved
> by overlay priorities, see below.
>
>> This impacts things like eglot-inlay-hints-mode or
>> overlay-error-string among other modes and has the affect of making
>> hints or annotations from these modes look out of place.
>
> Those 2 examples are not expected to be affected by the priority of
> the hl-line overlay, albeit for different reasons:
>
>   . eglot-inlay-hints-mode overlays have their priorities at 50+, and
>     these overlays display strings (so are similar to your snippet
>     below)
>   . overlay-error-string is not an overlay (despite its confusing
>     name)
>
>> I can reproduce this with something as minimal as:
>>
>> $ emacs -Q
>> $ M-:
>> (progn
>>   (setq hl-line-overlay-priority 10)
>>   (hl-line-mode)
>>   (erase-buffer)
>>   (insert ";; This buffer is for text that is not saved, and for Lisp evaluation.
>> ;; To create a file, visit it with ‘SPC f f’ and enter text in its buffer.")
>>   (let ((ov (make-overlay (+ (point-min) 2) (+ (point-min) 3))))
>>     (overlay-put ov 'before-string "foo")
>>     (overlay-put ov 'priority 5)))
>>
>> If you move the point to the first line you can see the overlay and its
>> face background completely disregards hl-lines background despite having
>> a lower priority.
>
> This is intended behavior: overlay priority affects only the text to
> which the overlay is applied.  In the above snippet, the overlay is
> applied to buffer text, whereas "foo" is an overlay string, and has
> its own face information (which defaults to the face of the underlying
> buffer text).  So the hl-line overlay's face does not affect the face
> of the before-string.
>
> There's no bug here, only a well-documented behavior.  See the node
> "Displaying Faces" in the ELisp manual for the details.

I'm therefore closing this bug report.





  reply	other threads:[~2024-06-30  6:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-30 22:27 bug#71282: 30.0.50; hl-line overlay priority has no affect Mohsin Kaleem
2024-05-31  5:44 ` Eli Zaretskii
2024-06-30  6:10   ` Stefan Kangas [this message]
2024-06-30 11:42     ` Mohsin Kaleem
2024-06-30 12:23       ` Eli Zaretskii
2024-06-30 13:41         ` Mohsin Kaleem
2024-06-30 14:46           ` Eli Zaretskii
2024-06-30 15:12             ` João Távora
2024-06-30 15:21               ` Mohsin Kaleem
2024-06-30 15:37                 ` Eli Zaretskii
2024-06-30 15:34               ` Eli Zaretskii
2024-06-30 15:50                 ` João Távora
2024-06-30 16:37                   ` João Távora
2024-06-30 17:36                   ` Eli Zaretskii
2024-06-30 18:09                     ` João Távora
2024-07-01 12:35                     ` Mohsin Kaleem
2024-07-01 13:50                       ` João Távora
2024-06-30 15:18             ` Mohsin Kaleem
2024-06-30 17:28               ` 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=CADwFkmmyB9UK+4RjibbM+FbtfsqesYmWnZaCi8OYsdU1Xmb-Yw@mail.gmail.com \
    --to=stefankangas@gmail.com \
    --cc=71282-done@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=mohkale@kisara.moe \
    /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).