I run Emacs in batch mode to execute some scripting actions. I'd like to get paths of files relative to where Emacs got started in batch mode:
(file-relative-name (buffer-file-name) directory-where-emacs-was-started)
I do not know how to find out directory-where-emacs-was-started
. default-directory
does not work because it defaults to buffer file directory and (default-value 'default-directory)
is nil
.
How to find out what I'm looking for?
Edit: clarification, I need as elisp variable the value that pwd
will print just before running Emacs in shell invocation like this:
pwd && emacs