Take the 2-minute tour ×

At the top of my elisp module, I want to do something as simple as:

(message (concat "Loading " (expand-file-name (current-elisp-module) ".")))
share|improve this question
add comment

1 Answer

up vote 8 down vote accepted

You can use the variable load-file-name, which is set by the function 'load. The documentation string is:

load-file-name is a variable defined in `lread.c'. Its value is nil

Documentation: Full name of file being loaded by `load'.

Note: buffer-file-name as a routine does not work as you might expect it to.

share|improve this answer
Thanks for rounding out the answer, Trey. I was more hurried than usual writing that, and figured it would be helpful to put it out sooner than later. –  seh Dec 29 '09 at 0:57
add comment

Your Answer


