diff --git a/core/autoload/buffers.el b/core/autoload/buffers.el index 0433fa706..edcc3de5d 100644 --- a/core/autoload/buffers.el +++ b/core/autoload/buffers.el @@ -242,18 +242,18 @@ project." (message "Killed %s buffers" n)))) ;;;###autoload -(defun doom/cleanup-session (&optional all-p interactive-p) +(defun doom/cleanup-session (&optional all-p) "Clean up buried buries and orphaned processes in the current workspace. If ALL-P (universal argument), clean them up globally." - (interactive (list current-prefix-arg 'interactive)) + (interactive (list current-prefix-arg)) (let ((buffers (doom-buried-buffers (if all-p (buffer-list)))) (n 0) kill-buffer-query-functions) (mapc #'kill-buffer buffers) (setq n (+ n (length buffers) (doom/cleanup-processes))) - (run-hooks 'doom-cleanup-hook) - (when interactive-p - (message "Cleaned up %s buffers" n)) + (dolist (hook doom-cleanup-hook) + (setq n (+ n (or (funcall hook) 1)))) + (message "Cleaned up %s buffers" n) n)) ;;;###autoload diff --git a/modules/feature/workspaces/autoload/workspaces.el b/modules/feature/workspaces/autoload/workspaces.el index de75ed19a..410757a9c 100644 --- a/modules/feature/workspaces/autoload/workspaces.el +++ b/modules/feature/workspaces/autoload/workspaces.el @@ -525,7 +525,7 @@ Ensures the scratch (or dashboard) buffers are CDed into the project's root." (cl-loop for buf in (buffer-list) unless (persp--buffer-in-persps buf) if (kill-buffer buf) - do (cl-incf n))) + sum 1)) ;;