Function: eca-chat--relativize-filename-for-workspace-root
eca-chat--relativize-filename-for-workspace-root is a natively
compiled function defined in eca-chat.el.
Signature
(eca-chat--relativize-filename-for-workspace-root FILENAME ROOTS &optional HIDE-FILENAME?)
Documentation
Relativize the FILENAME if a workspace root is found for ROOTS.
Show parent upwards if HIDE-FILENAME? is non nil.
Source Code
;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-chat.el
(defun eca-chat--relativize-filename-for-workspace-root (filename roots &optional hide-filename?)
"Relativize the FILENAME if a workspace root is found for ROOTS.
Show parent upwards if HIDE-FILENAME? is non nil."
(let ((relative-path (or (-some->> (-first (lambda (root) (f-ancestor-of? root filename)) roots)
(f-relative filename))
filename)))
(if hide-filename?
(f-parent relative-path)
relative-path)))