(defun my/new-workspace-with-current-window ()
  (interactive)
  (let* ((default-tag (buffer-name))
         (workspace-tag-from-user (read-from-minibuffer (concat "Tag for new workspace (" default-tag "): ")))
         (workspace-tag (if (string-empty-p workspace-tag-from-user) default-tag workspace-tag-from-user))
         (eyebrowse-new-workspace (buffer-name)))
    (eyebrowse-create-window-config)
    (eyebrowse-rename-window-config (eyebrowse--get 'current-slot) workspace-tag)))

(defun my/close-window-or-workspace ()
  (interactive)
  (cond ((> (list-length (window-list)) 1)
         (delete-window))
        ((> (list-length (eyebrowse--get 'window-configs)) 1)
         (eyebrowse-close-window-config))
        ((y-or-n-p "This is the last workspace. Close the perspective? ") (spacemacs/layouts-ts-close))))

(provide 'my-window-functions)

(defun my/new-workspace-with-current-window ()
  (interactive)
  (let* ((default-tag (buffer-name))
         (workspace-tag-from-user (read-from-minibuffer (concat "Tag for new workspace (" default-tag "): ")))
         (workspace-tag (if (string-empty-p workspace-tag-from-user) default-tag workspace-tag-from-user))
         (eyebrowse-new-workspace (buffer-name)))
    (delete-window)
    (eyebrowse-create-window-config)
    (eyebrowse-rename-window-config (eyebrowse--get 'current-slot) workspace-tag)))

(defun my/close-window-or-workspace ()
  (interactive)
  (cond ((> (list-length (window-list)) 1)
         (delete-window))
        ((> (list-length (eyebrowse--get 'window-configs)) 1)
         (eyebrowse-close-window-config))
        ((y-or-n-p "This is the last workspace. Close the perspective? ") (spacemacs/layouts-ts-close))))

(provide 'my-window-functions)

Delete the window from the last workspace when running C-w T
Spacemacs: Delete the window from the last workspace when running C-w T

akirak/user-admin,akirak/user-admin