From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71282: 30.0.50; hl-line overlay priority has no affect Date: Fri, 31 May 2024 08:44:23 +0300 Message-ID: <8634pyr0w8.fsf@gnu.org> References: <87plt3lyvd.fsf@kisara.moe> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30718"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71282@debbugs.gnu.org To: Mohsin Kaleem Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 31 07:45:19 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sCv4o-0007mu-5t for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 31 May 2024 07:45:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCv4Q-0008CT-18; Fri, 31 May 2024 01:44:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCv4O-0008CD-L7 for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 01:44:52 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sCv4O-00014S-9Z for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 01:44:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sCv4Y-0006Vd-Cf for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 01:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 May 2024 05:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71282 X-GNU-PR-Package: emacs Original-Received: via spool by 71282-submit@debbugs.gnu.org id=B71282.171713429024982 (code B ref 71282); Fri, 31 May 2024 05:45:02 +0000 Original-Received: (at 71282) by debbugs.gnu.org; 31 May 2024 05:44:50 +0000 Original-Received: from localhost ([127.0.0.1]:52974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCv4L-0006Uq-Bf for submit@debbugs.gnu.org; Fri, 31 May 2024 01:44:49 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38808) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCv4F-0006UW-9p; Fri, 31 May 2024 01:44:47 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCv3x-0000yQ-Pe; Fri, 31 May 2024 01:44:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=3Bt6Y3mNTSagfl81ZgY0nImwFSjCNkdeM3V1YOmOSYs=; b=UTNYW+YcE+k/dgesxXfS kGFtDkswmLyyQ0ZXFg7etfz7cDjP0HOSifw7NfHOfWZ6kiodME7MHhkge+wgiyOH4S6ZpP9dAtS6q DGaTidukzIOncsszDsdB3L2nieqjD6+UJYQzuiOB5xqk4YZ04KCvVzX6gChBh8lLcaohPGcBcDbBP 22F5+laLny35CQGFzcFmUVsWNnpHq2k701fsC/hHiDDVCubEpm7bJOLMyI0vqtlb4f14y/Ur7oXOP UI3/gWuBSxU4HYQgwuSuk9ut55eLuhcbs9cBs1DJf+/HO3nNeuuGgBQb4PvfRtpDsjIHBTbIojbmE vstKxAJ/JB0gsg==; In-Reply-To: <87plt3lyvd.fsf@kisara.moe> (message from Mohsin Kaleem on Thu, 30 May 2024 23:27:02 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286253 Archived-At: tags 71282 notabug thanks > From: Mohsin Kaleem > 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.