doom/cleanup-session: don't kill processes by default
This commit is contained in:
parent
500519fe00
commit
d80802d3c9
1 changed files with 5 additions and 4 deletions
|
@ -267,7 +267,7 @@ that belong to the current project."
|
||||||
(unless project-p
|
(unless project-p
|
||||||
(delete-other-windows))
|
(delete-other-windows))
|
||||||
(switch-to-buffer (doom-fallback-buffer))
|
(switch-to-buffer (doom-fallback-buffer))
|
||||||
(doom/cleanup-session (if project-p (doom-project-buffer-list))))
|
(doom/cleanup-session nil (if project-p (doom-project-buffer-list))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/kill-other-buffers (&optional project-p)
|
(defun doom/kill-other-buffers (&optional project-p)
|
||||||
|
@ -299,17 +299,18 @@ project."
|
||||||
(message "Killed %s buffers" n))))
|
(message "Killed %s buffers" n))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/cleanup-session (&optional buffer-list)
|
(defun doom/cleanup-session (arg &optional buffer-list)
|
||||||
"Clean up buried buries and orphaned processes in the current workspace. If
|
"Clean up buried buries and orphaned processes in the current workspace. If
|
||||||
ALL-P (universal argument), clean them up globally."
|
ALL-P (universal argument), clean them up globally."
|
||||||
(interactive)
|
(interactive "P")
|
||||||
(let ((buffers (doom-buried-buffers buffer-list))
|
(let ((buffers (doom-buried-buffers buffer-list))
|
||||||
(n 0))
|
(n 0))
|
||||||
(dolist (buf buffers)
|
(dolist (buf buffers)
|
||||||
(unless (buffer-modified-p buf)
|
(unless (buffer-modified-p buf)
|
||||||
(kill-buffer buf)
|
(kill-buffer buf)
|
||||||
(cl-incf n)))
|
(cl-incf n)))
|
||||||
(setq n (+ n (doom/cleanup-buffer-processes)))
|
(when arg
|
||||||
|
(setq n (+ n (doom/cleanup-buffer-processes))))
|
||||||
(dolist (hook doom-cleanup-hook)
|
(dolist (hook doom-cleanup-hook)
|
||||||
(let ((m (funcall hook)))
|
(let ((m (funcall hook)))
|
||||||
(when (integerp m)
|
(when (integerp m)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue