Function: majutsu-jj-expand-filename-from-jj
majutsu-jj-expand-filename-from-jj is a natively compiled function
defined in majutsu-jj.el.
Signature
(majutsu-jj-expand-filename-from-jj PATH &optional DIRECTORY)
Documentation
Expand PATH returned by jj into an Emacs-usable file name.
If PATH is an absolute local path and DIRECTORY is remote, prepend the remote prefix from DIRECTORY so the result remains remote.
Source Code
;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-jj.el
(defun majutsu-jj-expand-filename-from-jj (path &optional directory)
"Expand PATH returned by jj into an Emacs-usable file name.
If PATH is an absolute local path and DIRECTORY is remote, prepend the
remote prefix from DIRECTORY so the result remains remote."
(let* ((base (or directory default-directory))
(remote (file-remote-p base)))
(cond
((file-remote-p path)
(expand-file-name path))
((and remote (file-name-absolute-p path))
(concat remote path))
(t
(expand-file-name path base)))))