Function: eca-workspaces-compact-chat

eca-workspaces-compact-chat is an interactive and natively compiled function defined in eca-workspaces.el.

Signature

(eca-workspaces-compact-chat)

Documentation

Compact the chat at point sending the /compact command.

Asks for an optional extra prompt to guide the compaction.

Key Bindings

eca-workspaces-mode-map C

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-workspaces.el
(defun eca-workspaces-compact-chat ()
  "Compact the chat at point sending the /compact command.
Asks for an optional extra prompt to guide the compaction."
  (interactive)
  (let ((chat-buffer (eca-workspaces--chat-buffer-at-point-or-error))
        (extra (string-trim (read-string "Compact prompt (optional): "))))
    (with-current-buffer chat-buffer
      (let ((session (eca-session)))
        (eca-assert-session-running session)
        (when eca-chat--chat-loading
          (user-error "Chat is busy, wait or stop the running prompt"))
        (eca-chat--send-prompt session
                               (string-trim (concat "/compact " extra)))))))