Function: treemacs--read-workspaces

treemacs--read-workspaces is a byte-compiled function defined in treemacs-persistence.el.

Signature

(treemacs--read-workspaces ITER)

Documentation

Read a list of workspaces from the lines in ITER.

Returns a list with 2 elements: the first one is a list of all enabled workspaces, the second is a list of all non-disabled workspaces.

ITER: Treemacs-Iter Struct.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-persistence.el
(defun treemacs--read-workspaces (iter)
  "Read a list of workspaces from the lines in ITER.

Returns a list with 2 elements: the first one is a list of all enabled
workspaces, the second is a list of all non-disabled workspaces.

ITER: Treemacs-Iter Struct."
  (let ((workspaces)
        (comment-prefix "COMMENT "))
    (while (s-matches? treemacs--persist-workspace-name-regex (treemacs-iter->peek iter))
      (let ((workspace (treemacs-workspace->create!))
            (workspace-name (substring (treemacs-iter->next! iter) 2))
            (workspace-projects (treemacs--read-projects iter)))
        (when (s-starts-with? comment-prefix workspace-name)
          (setf workspace-name (substring workspace-name (length comment-prefix))
                (treemacs-workspace->is-disabled? workspace) t))
        (setf (treemacs-workspace->name workspace) workspace-name
              (treemacs-workspace->projects workspace) workspace-projects)
        (push workspace workspaces)))
    (--separate (treemacs-workspace->is-disabled? it)
                (nreverse workspaces))))