GNU bug report logs - #55038
29.0.50; Does macroexp-file-name return nil unnecessarily?

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Wed, 20 Apr 2022 14:11:01 UTC

Severity: normal

Found in version 29.0.50

Full log


Message #8 received at 55038 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 55038 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#55038: 29.0.50; Does macroexp-file-name return nil
 unnecessarily? 
Date: Thu, 21 Apr 2022 13:57:19 +0200
Philip Kaludercic <philipk <at> 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




This bug report was last modified 3 years and 58 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.