lang/org: clean up temp org-agenda buffers

Now auto-kills temporary agenda buffers, so long as they weren't already
opened by the user and doesn't exist in any other workspace.
This commit is contained in:
Henrik Lissner 2019-10-04 13:57:20 -04:00
parent 423a38c758
commit f6a182d69c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -462,9 +462,9 @@ eldoc string."
(add-hook! 'org-agenda-finalize-hook
(defun +org-exclude-agenda-buffers-from-workspace-h ()
"Prevent temporarily-opened agenda buffers from being associated with the
current workspace."
current workspace (and clean them up)."
(when (and org-agenda-new-buffers (bound-and-true-p persp-mode))
(let (persp-autokill-buffer-on-remove)
(let ((persp-autokill-buffer-on-remove t))
(persp-remove-buffer org-agenda-new-buffers
(get-current-persp)
nil)))))