Fix doom/cleanup-session & +workspaces|cleanup-unassociated-buffers

Resolve void n variable errors and silent message.
This commit is contained in:
Henrik Lissner 2018-01-04 03:55:25 -05:00
parent 8ef3cf8ea7
commit 88f8c27a7d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 6 additions and 6 deletions

View file

@ -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

View file

@ -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))
;;