From: Lars Ingebrigtsen <larsi@gnus.org>
To: Philip Kaludercic <philipk@posteo.net>
Cc: 55038@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#55038: 29.0.50; Does macroexp-file-name return nil unnecessarily?
Date: Thu, 21 Apr 2022 13:57:19 +0200 [thread overview]
Message-ID: <87fsm67iow.fsf@gnus.org> (raw)
In-Reply-To: <875yn3zw07.fsf@posteo.net> (Philip Kaludercic's message of "Wed, 20 Apr 2022 14:10:00 +0000")
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
next prev parent reply other threads:[~2022-04-21 11:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 14:10 bug#55038: 29.0.50; Does macroexp-file-name return nil unnecessarily? Philip Kaludercic
2022-04-21 11:57 ` Lars Ingebrigtsen [this message]
2022-04-21 13:20 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fsm67iow.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=55038@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=philipk@posteo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.