Consider a macro like (defmacro foo () `(message "Defined in %s" ,(macroexp-file-name))) Why does this expand to (message "Defined in %s" nil) when evaluated directly in a file (say using `eval-buffer' or `eval-last-sexp`). Shouldn't it be fair to return the file name of the buffer, if nothing else can be used: