Function: eca-workspaces--render

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

Signature

(eca-workspaces--render)

Documentation

Render the dashboard into the current buffer.

Preserves point, per-window points and fold state across renders.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-workspaces.el
(defun eca-workspaces--render ()
  "Render the dashboard into the current buffer.
Preserves point, per-window points and fold state across renders."
  (let* ((inhibit-read-only t)
         (point-entity (eca-workspaces--entity-at (point)))
         (point-column (current-column))
         (window-states (-map #'eca-workspaces--window-state
                              (get-buffer-window-list nil nil t))))
    (erase-buffer)
    (let ((sessions (eca-workspaces--sorted-sessions)))
      (if (null sessions)
          (insert (propertize "No ECA session running, start one with M-x eca"
                              'face 'eca-workspaces-tree-chat-details-face)
                  "\n")
        (dolist (session sessions)
          (insert (eca-workspaces--workspace-line session))
          (unless (memq (eca--session-id session)
                        eca-workspaces--folded-sessions)
            (dolist (chat-buffer (eca-chat-buffers session))
              (insert (eca-workspaces--chat-line session chat-buffer)))))))
    (insert (eca-workspaces--footer))
    (eca-workspaces--restore-point point-entity point-column)
    (dolist (state window-states)
      (-let [(window entity column) state]
        (when-let* ((position (eca-workspaces--find-entity entity)))
          (set-window-point window
                            (save-excursion
                              (goto-char position)
                              (move-to-column (or column 0))
                              (point))))))))