Function: eca-chat-reset

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

Signature

(eca-chat-reset)

Documentation

Kill the current chat buffer, keeping the chat on the server.

Switch to the previous chat when the session has others, or start a fresh chat when this was the only one. The killed chat stays resumable; delete it explicitly with eca-chat-delete.

Key Bindings

eca-chat-mode-map C-c C-k

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-reset ()
  "Kill the current chat buffer, keeping the chat on the server.
Switch to the previous chat when the session has others, or start
a fresh chat when this was the only one.  The killed chat stays
resumable; delete it explicitly with `eca-chat-delete'."
  (interactive)
  (let* ((session (eca-session))
         (buffer (eca-chat--get-last-buffer session)))
    (eca-assert-session-running session)
    (when (and (buffer-live-p buffer)
               (buffer-local-value 'eca-chat--id buffer))
      (with-current-buffer buffer
        (eca-chat--stream-flush))
      (let ((sibling (eca-chat--sibling-chat-buffer session buffer)))
        ;; nil when the user cancelled the kill: the chat is still there.
        (when (kill-buffer buffer)
          (unless sibling
            (eca-chat--new-chat session)))))))