Fix doom-cleanup-hook breaking if hook didn't return an integer

This commit is contained in:
Henrik Lissner 2018-01-07 15:03:45 -05:00
parent 8f9175c25e
commit 4bd74d9653
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -252,7 +252,9 @@ ALL-P (universal argument), clean them up globally."
(mapc #'kill-buffer buffers) (mapc #'kill-buffer buffers)
(setq n (+ n (length buffers) (doom/cleanup-processes))) (setq n (+ n (length buffers) (doom/cleanup-processes)))
(dolist (hook doom-cleanup-hook) (dolist (hook doom-cleanup-hook)
(setq n (+ n (or (funcall hook) 1)))) (let ((m (funcall hook)))
(when (integerp m)
(setq n (+ n m)))))
(message "Cleaned up %s buffers" n) (message "Cleaned up %s buffers" n)
n)) n))