abbreviate-file-name

abbreviate-file-name is a compiled Lisp function in `files.el'.

(abbreviate-file-name FILENAME)

Return a version of FILENAME shortened using `directory-abbrev-alist'.
This also substitutes "~" for the user's home directory (unless the
home directory is a root directory) and removes automounter prefixes
(see the variable `automount-dir-prefix').