Function: eca-chat--completion-file-from-prompt-exit-function
eca-chat--completion-file-from-prompt-exit-function is a natively
compiled function defined in eca-chat-context.el.
Signature
(eca-chat--completion-file-from-prompt-exit-function ITEM STATUS)
Documentation
Add to files the selected ITEM.
Directories are not finalized: completion keeps going inside them; typing a space turns the directory into a filepath.
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--completion-file-from-prompt-exit-function (item _status)
"Add to files the selected ITEM.
Directories are not finalized: completion keeps going inside
them; typing a space turns the directory into a filepath."
(if (eca-chat--completion-item-directory-p item)
(eca-chat--completion-drill-in eca-chat-filepath-prefix)
(let* ((file (get-text-property 0 'eca-chat-completion-item item))
(start-pos (save-excursion
(search-backward eca-chat-filepath-prefix (line-beginning-position) t)))
(end-pos (point)))
(delete-region start-pos end-pos)
(eca-chat--insert (eca-chat--filepath->str (plist-get file :path) nil)))
(eca-chat--insert " ")))