From: Trevor Murphy Date: Wed, 12 Feb 2025 01:26:55 +0000 (-0800) Subject: Ignore dedicated windows in 'display-buffer-reuse-mode-window' X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9e2bf138cbe72147b7250082f050d5bddad230e2;p=emacs.git Ignore dedicated windows in 'display-buffer-reuse-mode-window' Ignore the dedicated windows unless the dedicated window is already displaying the buffer-to-be-displayed. In that case, the window may be reused, according to the setting of 'inhibit-same-window'. * lisp/window.el (display-buffer-reuse-mode-window): Check 'window-dedicated-p' before pushing the candidate window onto the stack. (Bug#76216) (cherry picked from commit b6efedd66a08103e547266279419e646fc659339) --- diff --git a/lisp/window.el b/lisp/window.el index 2176cde2cb2..1ecd2325ee5 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8444,6 +8444,8 @@ indirectly called by the latter." (cond ((memq major-mode allowed-modes) 'same) ((derived-mode-p allowed-modes) 'derived))))) (when (and mode? + (or (not (window-dedicated-p window)) + (eq buffer (window-buffer window))) (not (and inhibit-same-window-p (eq window curwin)))) (push window (if (eq curframe (window-frame window))