From 6ba6216a5105a777f7e2f8128bcb9c0a77b6b2c4 Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Tue, 31 Mar 2015 13:42:04 +0200 Subject: [PATCH] Ignore `highlight-nonselected-windows' for same buffer in two windows * lisp/simple.el (redisplay--update-region-highlights): Update. It looks really weird when the same buffer is opened in multiple windows and `highlight-nonselected-windows' is t. Especially when the mouse is pressed. --- lisp/simple.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/simple.el b/lisp/simple.el index 5185607..ce6e24e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4955,7 +4955,13 @@ also checks the value of `use-empty-active-region'." (redisplay--update-region-highlight (selected-window)) (unless (listp windows) (setq windows (window-list-1 nil nil t))) (if highlight-nonselected-windows - (mapc #'redisplay--update-region-highlight windows) + (mapc #'redisplay--update-region-highlight + (delq nil + (mapcar (lambda (w) + (unless (eq (window-buffer w) + (current-buffer)) + w)) + windows))) (let ((msw (and (window-minibuffer-p) (minibuffer-selected-window)))) (dolist (w windows) (if (or (eq w (selected-window)) (eq w msw)) -- 1.8.4