diff --git a/modules/feature/workspaces/autoload/workspaces.el b/modules/feature/workspaces/autoload/workspaces.el index 51d554431..e8b39c8e3 100644 --- a/modules/feature/workspaces/autoload/workspaces.el +++ b/modules/feature/workspaces/autoload/workspaces.el @@ -464,12 +464,6 @@ Allows a perspective-specific buffer list via `+workspaces-buffer-list'." (persp-add-buffer (current-buffer) (get-current-persp) nil) (force-mode-line-update t))) -;;;###autoload -(defun +workspaces|protect-buffers-in-other-persps () - "Return nil if this buffer is present in other perspectives/workspaces (bury -it, don't kill it)." - (not (persp-other-persps-with-buffer-except-nil (current-buffer)))) - ;;;###autoload (defun +workspaces|delete-associated-workspace (&optional frame) "Delete workspace associated with current frame. diff --git a/modules/feature/workspaces/config.el b/modules/feature/workspaces/config.el index 4518fe81f..16611dd59 100644 --- a/modules/feature/workspaces/config.el +++ b/modules/feature/workspaces/config.el @@ -114,9 +114,8 @@ Uses `+workspaces-main' to determine the name of the main workspace." ;; kill-buffer-query-functions (remove-hook 'kill-buffer-query-functions 'persp-kill-buffer-query-function) (add-hook 'kill-buffer-query-functions 'persp-kill-buffer-query-function t) - - ;; - (add-hook 'kill-buffer-query-functions #'+workspaces|protect-buffers-in-other-persps) + ;; Ensure buffers we've opened/switched to are auto-added to the + ;; current perspective (add-hook 'doom-after-switch-buffer-hook #'+workspaces|auto-add-buffer) ;; Remap `buffer-list' to current workspace's buffers in @@ -124,6 +123,5 @@ Uses `+workspaces-main' to determine the name of the main workspace." (advice-add #'doom-buffer-list :override #'+workspace-buffer-list)) (t (remove-hook 'doom-after-switch-buffer-hook #'+workspaces|auto-add-buffer) - (remove-hook 'kill-buffer-query-functions #'+workspaces|protect-buffers-in-other-persps) (advice-remove #'doom-buffer-list #'+workspace-buffer-list)))))