From: Juri Linkov Date: Mon, 29 Oct 2018 22:57:09 +0000 (+0200) Subject: * lisp/window.el (window--state-get-1): Check buffer-live-p in next-buffers X-Git-Tag: emacs-27.0.90~4244 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0c6e9a00046ffb1421563b06030a6ce3025ce1fa;p=emacs.git * lisp/window.el (window--state-get-1): Check buffer-live-p in next-buffers and prev-buffers. (Bug#32850) --- 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)))