Output feedback from buffer/session kill commands

This commit is contained in:
Henrik Lissner 2019-12-21 02:24:11 -05:00
parent 491e80a568
commit a49c0b6691
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 37 additions and 24 deletions

View file

@ -268,13 +268,20 @@ workspace to delete."
('error (+workspace-error ex t))))
;;;###autoload
(defun +workspace/kill-session ()
(defun +workspace/kill-session (&optional interactive)
"Delete the current session, all workspaces, windows and their buffers."
(interactive)
(unless (cl-every #'+workspace-delete (+workspace-list-names))
(+workspace-error "Could not clear session"))
(+workspace-switch +workspaces-main t)
(doom/kill-all-buffers (buffer-list)))
(interactive (list t))
(let ((windows (length (window-list)))
(persps (length (+workspace-list-names)))
(buffers 0))
(let ((persp-autokill-buffer-on-remove t))
(unless (cl-every #'+workspace-delete (+workspace-list-names))
(+workspace-error "Could not clear session")))
(+workspace-switch +workspaces-main t)
(setq buffers (doom/kill-all-buffers (buffer-list)))
(when interactive
(message "Killed %d workspace(s), %d window(s) & %d buffer(s)"
persps windows buffers))))
;;;###autoload
(defun +workspace/kill-session-and-quit ()