I can get the file path with:
(message (file-name-directory (or buffer-file-name load-file-name)))
But if the buffer in dired-mode, the above code evaluates to nil.
How can I get the folder path in dired-mode with elisp?
There's dired-directory
, however this Q&A indicates that it is unreliable in certain circumstances, and that default-directory
is a better choice.
default-directory
RETdired-directory
RET