mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
doom/cleanup-session: don't kill processes by default
This commit is contained in:
@ -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)
|
||||||
|
Reference in New Issue
Block a user