Function: consult--fast-abbreviate-file-name
consult--fast-abbreviate-file-name is a natively compiled function
defined in consult.el.
Signature
(consult--fast-abbreviate-file-name NAME)
Documentation
Return abbreviate file NAME.
This function is a pure variant of abbreviate-file-name, which
does not access the file system. This is important if we require
that the operation is fast, even for remote paths or paths on
network file systems.
Source Code
;; Defined in /nix/store/6higv2v1wk916v4ynnybyrdkfy2gq44d-emacs-packages-deps/share/emacs/site-lisp/elpa/consult-20261004.957/consult.el
(defun consult--fast-abbreviate-file-name (name)
"Return abbreviate file NAME.
This function is a pure variant of `abbreviate-file-name', which
does not access the file system. This is important if we require
that the operation is fast, even for remote paths or paths on
network file systems."
(save-match-data
(let (case-fold-search) ;; Assume that file system is case sensitive.
(setq name (directory-abbrev-apply name))
(if (string-match (with-memoization consult--fast-abbreviate-file-name
(directory-abbrev-make-regexp (expand-file-name "~")))
name)
(concat "~" (substring name (match-beginning 1)))
name))))