aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2021-06-01 10:29:33 +0200
committerLars Ingebrigtsen2021-06-01 10:29:33 +0200
commit062f5aa640db1b8208f9c45dd12fea08e85658d9 (patch)
tree959444051bab295a5a7af94e66b1c1116ea39013
parentd9ccc3fa2ac0ce1bd522ddc26070edfac55c69a7 (diff)
downloademacs-062f5aa640db1b8208f9c45dd12fea08e85658d9.tar.gz
emacs-062f5aa640db1b8208f9c45dd12fea08e85658d9.zip
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.
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/hl-line.el5
2 files changed, 9 insertions, 1 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 351295a2688..fe8789c60b3 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.
1991 1991
1992** Miscellaneous 1992** Miscellaneous
1993 1993
1994---
1995*** New variable 'hl-line-overlay-priority'.
1996This can be used to change the priority of the hl-line overlays.
1997
1998+++
1994*** New command 'mailcap-view-file'. 1999*** New command 'mailcap-view-file'.
1995This command will open a viewer based on the file type, as determined 2000This command will open a viewer based on the file type, as determined
1996by ~/.mailcap and related files and variables. 2001by ~/.mailcap and related files and variables.
diff --git a/lisp/hl-line.el b/lisp/hl-line.el
index 82952e934b6..26cfcc3f9cc 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.")
125(defvar hl-line-overlay-buffer nil 125(defvar hl-line-overlay-buffer nil
126 "Most recently visited buffer in which Hl-Line mode is enabled.") 126 "Most recently visited buffer in which Hl-Line mode is enabled.")
127 127
128(defvar hl-line-overlay-priority -50
129 "Priority used on the overlay used by hl-line.")
130
128;;;###autoload 131;;;###autoload
129(define-minor-mode hl-line-mode 132(define-minor-mode hl-line-mode
130 "Toggle highlighting of the current line (Hl-Line mode). 133 "Toggle highlighting of the current line (Hl-Line mode).
@@ -152,7 +155,7 @@ line about point in the selected window only."
152 155
153(defun hl-line-make-overlay () 156(defun hl-line-make-overlay ()
154 (let ((ol (make-overlay (point) (point)))) 157 (let ((ol (make-overlay (point) (point))))
155 (overlay-put ol 'priority -50) ;(bug#16192) 158 (overlay-put ol 'priority hl-line-overlay-priority) ;(bug#16192)
156 (overlay-put ol 'face hl-line-face) 159 (overlay-put ol 'face hl-line-face)
157 ol)) 160 ol))
158 161