Function: eca-workspaces--read-session

eca-workspaces--read-session is a natively compiled function defined in eca-workspaces.el.

Signature

(eca-workspaces--read-session)

Documentation

Return the session at point or ask the user to pick one.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-workspaces.el
(defun eca-workspaces--read-session ()
  "Return the session at point or ask the user to pick one."
  (or (eca-workspaces--session-at-point)
      (let ((sessions (eca-vals eca--sessions)))
        (cond
         ((null sessions) (user-error "No ECA session running"))
         ((null (cdr sessions)) (car sessions))
         (t (let* ((candidates
                    (-map (lambda (session)
                            (cons (eca--session-project-name session)
                                  session))
                          sessions))
                   (choice (completing-read "Workspace: "
                                            (-map #'car candidates)
                                            nil t)))
              (cdr (assoc choice candidates))))))))