]> git.eshelyaron.com Git - emacs.git/commitdiff
cursor-face-highlight-nonselected-window default to nil
authorJimmy Aguilar Mena <spacibba@aol.com>
Thu, 17 Mar 2022 22:28:07 +0000 (23:28 +0100)
committerJimmy Aguilar Mena <spacibba@aol.com>
Fri, 18 Mar 2022 21:57:45 +0000 (22:57 +0100)
* lisp/simple.el (redisplay--update-cursor-face-highlight) : Use if-let*
and not check facep.
(cursor-face-highlight-nonselected-window) : default to nil

lisp/simple.el

index 42f3a80c3f7e06bf05b7b562871269e38f1e9e80..369e11e47c3f857600a13f461a0759509a8eec51 100644 (file)
@@ -6540,7 +6540,7 @@ The overlay is returned by the function.")
         (unless (equal new rol)
           (set-window-parameter window 'internal-region-overlay new))))))
 
-(defcustom cursor-face-highlight-nonselected-window cursor-in-non-selected-windows
+(defcustom cursor-face-highlight-nonselected-window nil
   "Non-nil means highlight text with `cursor-face' even in nonselected windows.
 This variable is similar to `highlight-nonselected-windows'."
   :local t
@@ -6550,14 +6550,12 @@ This variable is similar to `highlight-nonselected-windows'."
 (defun redisplay--update-cursor-face-highlight (window)
   "Highlights the overlay used to highlight text with cursor-face."
   (let ((rol (window-parameter window 'internal-cursor-face-overlay)))
-    (if-let (((or cursor-face-highlight-nonselected-window
-                  (eq window (selected-window))
-                  (and (window-minibuffer-p)
-                       (eq window (minibuffer-selected-window)))))
-             (pt (window-point window))
-             (value (get-text-property pt 'cursor-face))
-             ;; Extra code needed here for when passing plists.
-             (cursor-face (if (facep value) value)))
+    (if-let* (((or cursor-face-highlight-nonselected-window
+                   (eq window (selected-window))
+                   (and (window-minibuffer-p)
+                        (eq window (minibuffer-selected-window)))))
+              (pt (window-point window))
+              (cursor-face (get-text-property pt 'cursor-face)))
         (let* ((start (previous-single-property-change
                        (1+ pt) 'cursor-face nil (point-min)))
                (end (next-single-property-change