]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix setter for hl-line-sticky-flag when hl-line is not loaded
authorPo Lu <luangruo@yahoo.com>
Thu, 24 Mar 2022 05:50:55 +0000 (13:50 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 24 Mar 2022 05:50:55 +0000 (13:50 +0800)
* lisp/hl-line.el (hl-line-sticky-flag): Wrap most of setter
around (featurep 'hl-line).  Reported by Michael Heerdegen
<michael_heerdegen@web.de>.

lisp/hl-line.el

index e42d1d97d9d8ba2de18b38f0d366101d1783b7c8..e5ca6819f0d149a24664236371a01553d2392a0a 100644 (file)
@@ -105,12 +105,13 @@ For that, use `global-hl-line-sticky-flag'."
   :group 'hl-line
   :set (lambda (symbol value)
          (set-default symbol value)
-         (unless value
-           (let ((selected (window-buffer (selected-window))))
-             (dolist (buffer (buffer-list))
-               (unless (eq buffer selected)
-                 (with-current-buffer buffer
-                   (hl-line-unhighlight))))))))
+         (when (featurep 'hl-line)
+           (unless value
+             (let ((selected (window-buffer (selected-window))))
+               (dolist (buffer (buffer-list))
+                 (unless (eq buffer selected)
+                   (with-current-buffer buffer
+                     (hl-line-unhighlight)))))))))
 
 (defcustom global-hl-line-sticky-flag nil
   "Non-nil means the Global HL-Line mode highlight appears in all windows.