From 9bcf58d27c7c9ebe3bdd4d0564808767420bd44c Mon Sep 17 00:00:00 2001 From: Jimmy Aguilar Mena Date: Thu, 17 Mar 2022 23:28:07 +0100 Subject: [PATCH] cursor-face-highlight-nonselected-window default to nil * 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 | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 42f3a80c3f7..369e11e47c3 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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 -- 2.39.2