dired-make-relative

dired-make-relative is a compiled Lisp function in `dired.el'.

(dired-make-relative FILE &optional DIR)

Convert FILE (an absolute file name) to a name relative to DIR.
If DIR is omitted or nil, it defaults to `default-directory'.
If FILE is not in the directory tree of DIR, return FILE
unchanged.