summaryrefslogtreecommitdiff
path: root/lisp/hl-line.el
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-03-22 08:19:32 +0800
committerPo Lu <luangruo@yahoo.com>2022-03-22 08:19:32 +0800
commitf36d929ee768f03dcc63f59ff0572c2681c8f749 (patch)
treea1e964c73abc949e5745da3888da09ba4e57c2f7 /lisp/hl-line.el
parenta5e8da4fa28a233f3c1dee25a31072df7db6cf61 (diff)
downloademacs-f36d929ee768f03dcc63f59ff0572c2681c8f749.tar.gz
Fix incompatible changes in hl-line
* lisp/hl-line.el (hl-line-face): Rename back to hl-line. (hl-line-face): Restore defcustom.
Diffstat (limited to 'lisp/hl-line.el')
-rw-r--r--lisp/hl-line.el15
1 files changed, 13 insertions, 2 deletions
diff --git a/lisp/hl-line.el b/lisp/hl-line.el
index daa24c4fbf3..47d5b0f247e 100644
--- a/lisp/hl-line.el
+++ b/lisp/hl-line.el
@@ -47,11 +47,22 @@
:version "21.1"
:group 'convenience)
-(defface hl-line-face '((t :inherit highlight :extend t))
+(defface hl-line '((t :inherit highlight :extend t))
"Default face for highlighting the current line in hl-line-mode."
:version "22.1"
:group 'hl-line)
+(defcustom hl-line-face 'hl-line
+ "Face with which to highlight the current line in Hl-Line mode."
+ :type 'face
+ :group 'hl-line
+ :set (lambda (symbol value)
+ (set symbol value)
+ (dolist (buffer (buffer-list))
+ (with-current-buffer buffer
+ (when hl-line--overlay
+ (overlay-put hl-line--overlay 'face hl-line-face))))))
+
(defcustom hl-line-sticky-flag t
"Non-nil to preserve highlighting overlay when focus leaves window."
:type 'boolean
@@ -105,7 +116,7 @@ Currently used in calendar/todo-mode."
(let ((ol (make-overlay (point) (point))))
(prog1 ol
(overlay-put ol 'priority hl-line-overlay-priority)
- (overlay-put ol 'face 'hl-line-face)))))
+ (overlay-put ol 'face hl-line-face)))))
(move-overlay hl-line--overlay
(line-beginning-position)
(line-beginning-position 2))