From 0c6e9a00046ffb1421563b06030a6ce3025ce1fa Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 30 Oct 2018 00:57:09 +0200 Subject: [PATCH] * lisp/window.el (window--state-get-1): Check buffer-live-p in next-buffers and prev-buffers. (Bug#32850) --- lisp/window.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/window.el b/lisp/window.el index 27d7e42280f..bcd4fa29590 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5552,9 +5552,14 @@ specific buffers." (buffer (window-buffer window)) (selected (eq window (selected-window))) (next-buffers (when (window-live-p window) - (window-next-buffers window))) + (delq nil (mapcar (lambda (buffer) + (and (buffer-live-p buffer) buffer)) + (window-next-buffers window))))) (prev-buffers (when (window-live-p window) - (window-prev-buffers window))) + (delq nil (mapcar (lambda (entry) + (and (buffer-live-p (nth 0 entry)) + entry)) + (window-prev-buffers window))))) (head `(,type ,@(unless (window-next-sibling window) `((last . t))) -- 2.39.5