diff --git a/perspective-exwm.el b/perspective-exwm.el index 80febb3..7d50308 100644 --- a/perspective-exwm.el +++ b/perspective-exwm.el @@ -231,9 +231,42 @@ Overrides `persp-initial-frame-name' according to `perspective-exwm-override-ini (format "main-%s" (funcall exwm-workspace-index-map workspace-index))))) (apply fun args))) +;;;###autoload +(defun perspective-exwm-revive-perspectives () + "Make perspectives in the current frame not killed." + (interactive) + (let ((to-switch nil)) + (maphash + (lambda (_ v) + (setf (persp-killed v) nil) + (unless to-switch + (setq to-switch v))) + (frame-parameter nil 'persp--hash)) + (when to-switch + (persp-switch (persp-name to-switch))))) + + + ;;;###autoload (define-minor-mode perspective-exwm-mode - "A minor mode for intergrating perspective.el and EXWM." + "A minor mode for intergrating perspective.el and EXWM. + +The mode does a couple of things: + - fixes a bug with half-killing the current perspective when closing + a floating window. I haven't tested this as thoroughly, so run + `perspective-exwm-revive-perspectives' if the problem arises + anyway. + - adjusts the name of the inital perspective in the new workspace. + It tries to get the name from the + `perspective-exwm-override-initial-name' variable and falls back to + \"main-\". + +The latter also serves a purpose, because otherwise there are +issues with multiple perspectives sharing the same scratch +buffer. + +Be sure to activate this mode before `exwm-enable', so that the +inital workspaces are created with the new perspective names." :global t :after-hook (progn @@ -252,7 +285,5 @@ Overrides `persp-initial-frame-name' according to `perspective-exwm-override-ini (advice-remove #'exwm-workspace-switch-create #'perspective-exwm--workspace-switch-create-around)))) -(advice-mapc 'prin1-to-string 'persp-delete-frame) - (provide 'perspective-exwm) ;;; perspective-exwm.el ends here