feature/workspaces: add switch-or-create functionality to +workspace-switch
This commit is contained in:
parent
4b63d79f68
commit
552684564e
1 changed files with 4 additions and 2 deletions
|
@ -121,10 +121,12 @@ perspective or its hash table."
|
||||||
(persp-kill name inhibit-kill-p))
|
(persp-kill name inhibit-kill-p))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +workspace-switch (name)
|
(defun +workspace-switch (name &optional auto-create-p)
|
||||||
"Switch to another workspace."
|
"Switch to another workspace."
|
||||||
(unless (+workspace-exists-p name)
|
(unless (+workspace-exists-p name)
|
||||||
(error "%s is not an available workspace" name))
|
(if auto-create-p
|
||||||
|
(+workspace-new name)
|
||||||
|
(error "%s is not an available workspace" name)))
|
||||||
(persp-frame-switch name))
|
(persp-frame-switch name))
|
||||||
|
|
||||||
(defun +workspace--generate-id ()
|
(defun +workspace--generate-id ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue