feature/workspaces: Fix +workspace-delete to match docstring

This commit is contained in:
Quentin Le Guennec 2018-10-27 00:00:13 +02:00
parent 86305f2175
commit db9bc3848d

View file

@ -172,15 +172,17 @@ success, nil otherwise."
(persp-rename new-name (+workspace-get name))) (persp-rename new-name (+workspace-get name)))
;;;###autoload ;;;###autoload
(defun +workspace-delete (name &optional inhibit-kill-p) (defun +workspace-delete (workspace &optional inhibit-kill-p)
"Delete the workspace denoted by NAME, which can be the name of a perspective "Delete the workspace denoted by WORKSPACE, which can be the name of a perspective
or its hash table. If INHIBIT-KILL-P is non-nil, don't kill this workspace's or its hash table. If INHIBIT-KILL-P is non-nil, don't kill this workspace's
buffers." buffers."
(when (+workspace--protected-p name) (unless (stringp workspace)
(error "Can't delete '%s' workspace" name)) (setq workspace (persp-name workspace)))
(+workspace-get name) ; error checking (when (+workspace--protected-p workspace)
(persp-kill name inhibit-kill-p) (error "Can't delete '%s' workspace" workspace))
(not (+workspace-exists-p name))) (+workspace-get workspace) ; error checking
(persp-kill workspace inhibit-kill-p)
(not (+workspace-exists-p workspace)))
;;;###autoload ;;;###autoload
(defun +workspace-switch (name &optional auto-create-p) (defun +workspace-switch (name &optional auto-create-p)