doom/cleanup-session: don't kill modified buffers

This commit is contained in:
Henrik Lissner 2018-05-30 23:06:13 +02:00
parent abd8f87e28
commit d2ca6f65b3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -244,8 +244,11 @@ ALL-P (universal argument), clean them up globally."
(interactive)
(let ((buffers (doom-buried-buffers buffer-list))
(n 0))
(mapc #'kill-buffer buffers)
(setq n (+ n (length buffers) (doom/cleanup-buffer-processes)))
(dolist (buf buffers)
(unless (buffer-modified-p buf)
(kill-buffer buf)
(cl-incf n)))
(setq n (+ n (doom/cleanup-buffer-processes)))
(dolist (hook doom-cleanup-hook)
(let ((m (funcall hook)))
(when (integerp m)