diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index e4bc2df280..5df9d4b221 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -143,7 +143,8 @@ macroexp-file-name ;; so prefer using it over using `load-file-name'. (let ((file (car (last current-load-list)))) (or (if (stringp file) file) - (bound-and-true-p byte-compile-current-file)))) + (bound-and-true-p byte-compile-current-file) + (buffer-file-name)))) (defvar macroexp--warned (make-hash-table :test #'equal :weakness 'key))