Created
September 3, 2018 18:28
-
-
Save nxtr/9926d06b01b7e1b94df46fe414847c29 to your computer and use it in GitHub Desktop.
Convert filename NAME to absolute and canonicalize, starting with directory of `load-file-name' or `buffer-file-name' or `default-directory' if NAME is relative (does not start with slash or tilde).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun expand-file-name-current-directory (name) | |
"Convert filename NAME to absolute and canonicalize, starting with directory | |
of `load-file-name' or `buffer-file-name' or `default-directory' if NAME | |
is relative (does not start with slash or tilde)." | |
(let ((dir (file-name-directory (or load-file-name buffer-file-name "")))) | |
(expand-file-name name dir))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment