Function: eca-chat--get-last-visited-buffer

eca-chat--get-last-visited-buffer is a natively compiled function defined in eca-chat-context.el.

Signature

(eca-chat--get-last-visited-buffer)

Documentation

Return the last visited file buffer inside a session workspace.

More recent file buffers outside any session workspace root are skipped so the cursor context keeps pointing to workspace files.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-chat-context.el
(defun eca-chat--get-last-visited-buffer ()
  "Return the last visited file buffer inside a session workspace.
More recent file buffers outside any session workspace root are
skipped so the cursor context keeps pointing to workspace files."
  (-first (lambda (buff)
            (when (buffer-live-p buff)
              (-some-> (buffer-file-name buff)
                (eca-chat--session-for-path))))
          (buffer-list)))