doom/kill-all-buffers: reduce redundancy

This commit is contained in:
Henrik Lissner 2018-03-22 06:31:09 -04:00
parent a2ab9e739c
commit 358d7af9ac
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -202,13 +202,9 @@ If DONT-SAVE, don't prompt to save modified buffers (discarding their changes)."
If PROJECT-P (universal argument), kill only buffers that belong to the current If PROJECT-P (universal argument), kill only buffers that belong to the current
project." project."
(interactive "P") (interactive "P")
(let ((buffers (if project-p (doom-project-buffer-list) (doom-buffer-list))) (delete-other-windows)
(ignore-window-parameters t)) (switch-to-buffer (doom-fallback-buffer))
(delete-other-windows) (doom/cleanup-session))
(switch-to-buffer (doom-fallback-buffer))
(let (kill-buffer-query-functions)
(message "Killed %s buffers"
(length (delq nil (mapcar #'kill-buffer buffers)))))))
;;;###autoload ;;;###autoload
(defun doom/kill-other-buffers (&optional project-p) (defun doom/kill-other-buffers (&optional project-p)