Given you started Emacs passing a LISP file through command line:
emacs --load .custom.d/init.el
how it could be possible to dynamically obtain
custom.el directory location?
Since the default
init.el is not used,
buffer-file-name is not a possible solution:
(file-name-directory (or load-file-name (buffer-file-name)))
I have also tried to eval
default-directory as follows:
cd /tmp/username mkdir custom.d touch custom.d/init.el emacs -nw --load custom.d/init.el --eval "(print default-directory)"
however the directory from where emacs was invoked (i.e.
/tmp/username in) is shown, not the