Function: eca-chat-select
eca-chat-select is an interactive and natively compiled function
defined in eca-chat.el.
Signature
(eca-chat-select)
Documentation
Select a chat.
Shows each chat with its status (🚧 pending approval, ⏳ loading), title, and elapsed time annotation.
Key Bindings
eca-chat-mode-map C-c C-f
Source Code
;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-chat.el
;;;###autoload
(defun eca-chat-select ()
"Select a chat.
Shows each chat with its status (🚧 pending approval, ⏳ loading),
title, and elapsed time annotation."
(interactive)
(let* ((session (eca-session))
(buf-by-label (make-hash-table :test 'equal))
(annotation-by-label (make-hash-table :test 'equal)))
(eca-assert-session-running session)
;; Build items oldest-first (same order as tab-line)
(let ((items (append
(nreverse
(-keep (lambda (buffer)
(when (buffer-live-p buffer)
(with-current-buffer buffer
(let* ((title (eca-chat-title))
(status (eca-chat--chat-status-prefix))
(label (concat status title))
;; Disambiguate duplicate titles
(label (if (gethash label buf-by-label)
(concat label " (" eca-chat--id ")")
label))
(face (cond
((eca-chat--has-pending-approvals-p) 'warning)
(eca-chat--chat-loading 'shadow)
(t nil)))
(display (if face
(propertize label 'face face)
label))
(time-str (eca-chat--turn-duration-str)))
(puthash display buffer buf-by-label)
(when time-str
(puthash display
(propertize (concat " " time-str)
'face 'eca-chat-elapsed-time-face)
annotation-by-label))
display))))
(eca-vals (eca--session-chats session))))
(list eca-chat-new-chat-label))))
(when-let (chosen (completing-read
"Select the chat: "
(lambda (string pred action)
(if (eq action 'metadata)
`(metadata
(display-sort-function . ,#'identity)
(annotation-function
. ,(lambda (candidate)
(gethash candidate annotation-by-label))))
(complete-with-action action items string pred)))
nil t))
(if-let (buffer (gethash chosen buf-by-label))
(progn
(setf (eca--session-last-chat-buffer session) buffer)
(eca-chat-open session))
(eca-chat-new))))))