Function: treemacs-remove-project-from-workspace
treemacs-remove-project-from-workspace is an interactive and
byte-compiled function defined in treemacs-interface.el.
Signature
(treemacs-remove-project-from-workspace &optional ARG)
Documentation
Remove the project at point from the current workspace.
With a prefix ARG select project to remove by name.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-interface.el
(defun treemacs-remove-project-from-workspace (&optional arg)
"Remove the project at point from the current workspace.
With a prefix ARG select project to remove by name."
(interactive "P")
(let ((project (treemacs-project-at-point))
(save-pos))
(when (or arg (null project))
(setf project (treemacs--select-project-by-name)
save-pos (not (equal project (treemacs-project-at-point)))))
(pcase (if save-pos
(treemacs-save-position
(treemacs-do-remove-project-from-workspace project nil :ask))
(treemacs-do-remove-project-from-workspace project nil :ask))
(`success
(whitespace-cleanup)
(treemacs-pulse-on-success "Removed project %s from the workspace."
(propertize (treemacs-project->name project) 'face 'font-lock-type-face)))
(`user-cancel
(ignore))
(`cannot-delete-last-project
(treemacs-pulse-on-failure "Cannot delete the last project."))
(`(invalid-project ,reason)
(treemacs-pulse-on-failure "Cannot delete project: %s"
(propertize reason 'face 'font-lock-string-face))))))