Created
December 9, 2018 23:51
-
-
Save nxtr/644d712fe8ae629068129c2f4b34ab95 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 startwith 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
(eval-and-compile | |
(unless (fboundp 'expand-file-name-current-directory) | |
(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 startwith 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