From a086e6967e2bd4a3b62df23b6c04e4fa7c2b7021 Mon Sep 17 00:00:00 2001 From: Andrew Whatson Date: Sun, 17 Mar 2019 00:45:23 +1000 Subject: [PATCH] Fixes for doom/kill-this-buffer-in-all-windows This was erroring when run inside a popup (eg. `M-x ielm` `C-x k`) due to a missing check for `window-live-p`. We don't need to do anything if the window has already gone away. The real vs unreal check was backwards; we should only try `previous-buffer` if the current buffer is *not* real. --- core/autoload/buffers.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/autoload/buffers.el b/core/autoload/buffers.el index 2d0002714..8889e3b78 100644 --- a/core/autoload/buffers.el +++ b/core/autoload/buffers.el @@ -251,7 +251,8 @@ If DONT-SAVE, don't prompt to save modified buffers (discarding their changes)." (set-buffer-modified-p nil))) (kill-buffer buffer) (cl-loop for win in windows - if (doom-real-buffer-p (window-buffer win)) + if (and (window-live-p win) + (doom-unreal-buffer-p (window-buffer win))) do (with-selected-window win (previous-buffer))))) ;;;###autoload