[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#55038: 29.0.50; Does macroexp-file-name return nil unnecessarily?
From: |
Lars Ingebrigtsen |
Subject: |
bug#55038: 29.0.50; Does macroexp-file-name return nil unnecessarily? |
Date: |
Thu, 21 Apr 2022 13:57:19 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Philip Kaludercic <philipk@posteo.net> writes:
> 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:
[...]
> Or is there something that would go wrong in that case?
Such a change sounds like a good one to me, but perhaps there's a good
reason it works the way it does today. Perhaps Stefan has a comment;
added to the CCs.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no