Previous: , Up: Directory and File Variables and Functions   [Index]


7.2.3.17 abbreviate-file-name

Converts a directory name to its abbreviation. You can use this function for directory names and for file names, because it recognizes abbreviations even as part of the name.

Function: abbreviate-file-name filename
FILENAME

an absolute file name upon which to operate;

RETURN VALUE

a shortened version of FILENAME, using directory-abbrev-alist. Also substitute ‘~’ for the user’s home directory and remove automounter prefixes.

When this function is first called, it caches the user’s home directory as a regexp in abbreviated-home-dir, and reuses it afterwards.