GNU bug report logs -
#71282
30.0.50; hl-line overlay priority has no affect
Previous Next
Reported by: Mohsin Kaleem <mohkale <at> kisara.moe>
Date: Thu, 30 May 2024 22:37:01 UTC
Severity: normal
Tags: notabug
Found in version 30.0.50
Done: Stefan Kangas <stefankangas <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Sat, 29 Jun 2024 23:10:34 -0700
with message-id <CADwFkmmyB9UK+4RjibbM+FbtfsqesYmWnZaCi8OYsdU1Xmb-Yw <at> mail.gmail.com>
and subject line Re: bug#71282: 30.0.50; hl-line overlay priority has no affect
has caused the debbugs.gnu.org bug report #71282,
regarding 30.0.50; hl-line overlay priority has no affect
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
71282: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71282
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Hi there,
Looks like there's no way to give hl-line a higher priority than other
text overlays. 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. 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.
In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.41, cairo version 1.18.0) of 2024-05-08 built on mk-desktop
Repository revision: 840c33070dc789d5095a47fa65f4f77564cd6e59
Repository branch: master
System Description: Arch Linux
Configured using:
'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
--localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games
--with-modules --without-m17n-flt --without-gconf
--with-native-compilation=yes --with-xinput2 --with-x-toolkit=gtk3
--without-xaw3d --with-sound=no --with-tree-sitter --without-gpm
--without-compress-install
'--program-transform-name=s/\([ec]tags\)/\1.emacs/'
'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions
-Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security
-fstack-clash-protection -fcf-protection -fno-omit-frame-pointer
-mno-omit-leaf-frame-pointer -g
-ffile-prefix-map=/home/mohkale/.cache/yay/emacs-git/src=/usr/src/debug/emacs-git
-flto=auto' 'LDFLAGS=-Wl,-O1 -Wl,--sort-common -Wl,--as-needed
-Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto''
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY
PDUMPER PNG RSVG SECCOMP SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB
Important settings:
value of $LC_MESSAGES: C
value of $LC_TIME: en_GB.UTF-8
value of $LANG: en_GB.UTF-8
locale-coding-system: utf-8-unix
Major mode: Lisp Interaction
Minor modes in effect:
hl-line-mode: t
straight-use-package-mode: t
straight-package-neutering-mode: t
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
minibuffer-regexp-mode: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util time-date mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils hl-line compile
text-property-search comint ansi-osc ansi-color ring comp-run
comp-common rx straight-autoloads cl-seq cl-extra help-mode straight
cl-macs cl-loaddefs cl-lib +core-setup-paths xdg subr-x term/st
term/xterm xterm byte-opt gv bytecomp byte-compile rmc iso-transl
tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd
touch-screen tool-bar dnd fontset image regexp-opt fringe tabulated-list
replace newcomment text-mode lisp-mode prog-mode register page tab-bar
menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse
jit-lock font-lock syntax font-core term/tty-colors frame minibuffer
nadvice seq simple cl-generic indonesian philippine cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop
case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo gtk x-toolkit xinput2 x multi-tty move-toolbar
make-network-process native-compile emacs)
Memory information:
((conses 16 135391 97166) (symbols 48 12063 45)
(strings 32 37667 9732) (string-bytes 1 2453600) (vectors 16 17732)
(vector-slots 8 966098 204470) (floats 8 37 12)
(intervals 56 463 162) (buffers 992 13))
--
Mohsin Kaleem
[Message part 3 (message/rfc822, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
> tags 71282 notabug
> thanks
>
>> From: Mohsin Kaleem <mohkale <at> 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.
This bug report was last modified 1 year and 16 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.