Open ksqsf opened 3 years ago
(defun -treemacs-add-project-to-workspace-or-switch ()
"Add the current project to the default workspace, or locate it if it's already known in a workspace.
The default workspace is specificied by `prelude-treemacs-default-workspace'"
(let (current-file-ws (-treemacs-which-workspace))
(if current-file-ws
(-treemacs-switch-to-workspace current-file-ws)
(let (default-ws (-treemacs-get-or-create-workspace prelude-treemacs-default-workspace))
(-treemacs-switch-to-workspace default-ws)
(treemacs-display-current-project-exclusively)))))
And this doesn't seem to work? It reports Wrong type argument: arrayp, nil
.
edit: oops I missed a pair of parens.
Hopefully there will be some better API to serve the users' needs. :-)
Apis need to be used to find their gaps. This stuff has never come up before and the first step to getting new features is to ask :shrug:
The things you're asking for sound all reasonable and doable to me, so let's make a list:
Anything else?
Maybe create
and remove
? I think something like with-treemacs-workspace
can be helpful too.
Pushed api to find workspaces now.
Maybe create and remove?
Those already exist with treemcs-do-create/remove-workspace
. When there's a split for interactive and non-interactive code the former is called treemacs-X
and the latter is called treemacs-do-X
.
I think something like with-treemacs-workspace can be helpful too.
There's already treemacs-override-workspace
, but yes, it's better to have a well-named macro.
Deleting workspace by name wasn't on the list, but it's pushed now anyway.
treemacs-with-workspace
macro is pushed as well.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Stayin alive.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Stayin alive.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Stayin alive.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Stayin alive.
This issue has been automatically marked as stale because it has not had recent activity.
Hi,
I want to enhance my treemacs experience by adding the current project automatically to an appropriate workspace, that is
I have figured out that I can use
treemacs-workspaces
,treemacs-workspace->projects
, etc. to query information about workspaces, but what confuses me is the "adding" part. It seems that I can't simply add a project to a workspace object, but have to switch to that workspace first, and then add it to "the current workspace".Ok, so I keep on reading the doc, only to find that there's no API that can get a workspace object by its name. I replicated some bits of the code, and it may be useful to others.
Hopefully there will be some better API to serve the users' needs. :-)