emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 062f5aa: Allow packages to change the hl-line overlay priority


From: Lars Ingebrigtsen
Subject: master 062f5aa: Allow packages to change the hl-line overlay priority
Date: Tue, 1 Jun 2021 04:29:41 -0400 (EDT)

branch: master
commit 062f5aa640db1b8208f9c45dd12fea08e85658d9
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Allow packages to change the hl-line overlay priority
    
    * lisp/hl-line.el (hl-line-overlay-priority): New variable
    (bug#11509).
    (hl-line-make-overlay): Use it.
---
 etc/NEWS        | 5 +++++
 lisp/hl-line.el | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index 351295a..fe8789c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1991,6 +1991,11 @@ Shift while typing 'C-a', i.e. 'C-S-a', will now 
highlight the text.
 
 ** Miscellaneous
 
+---
+*** New variable 'hl-line-overlay-priority'.
+This can be used to change the priority of the hl-line overlays.
+
++++
 *** New command 'mailcap-view-file'.
 This command will open a viewer based on the file type, as determined
 by ~/.mailcap and related files and variables.
diff --git a/lisp/hl-line.el b/lisp/hl-line.el
index 82952e9..26cfcc3 100644
--- a/lisp/hl-line.el
+++ b/lisp/hl-line.el
@@ -125,6 +125,9 @@ This variable is expected to be made buffer-local by 
modes.")
 (defvar hl-line-overlay-buffer nil
   "Most recently visited buffer in which Hl-Line mode is enabled.")
 
+(defvar hl-line-overlay-priority -50
+  "Priority used on the overlay used by hl-line.")
+
 ;;;###autoload
 (define-minor-mode hl-line-mode
   "Toggle highlighting of the current line (Hl-Line mode).
@@ -152,7 +155,7 @@ line about point in the selected window only."
 
 (defun hl-line-make-overlay ()
   (let ((ol (make-overlay (point) (point))))
-    (overlay-put ol 'priority -50)           ;(bug#16192)
+    (overlay-put ol 'priority hl-line-overlay-priority) ;(bug#16192)
     (overlay-put ol 'face hl-line-face)
     ol))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]