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.
This commit is contained in:
Andrew Whatson 2019-03-17 00:45:23 +10:00
parent 05467bb770
commit a086e6967e

View File

@ -251,7 +251,8 @@ If DONT-SAVE, don't prompt to save modified buffers (discarding their changes)."
(set-buffer-modified-p nil))) (set-buffer-modified-p nil)))
(kill-buffer buffer) (kill-buffer buffer)
(cl-loop for win in windows (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))))) do (with-selected-window win (previous-buffer)))))
;;;###autoload ;;;###autoload