GNU bug report logs - #14121
Fwd: Eager macroexpansion failure in Emacs 24.3

Previous Next

Package: emacs;

Reported by: Michael Olson <mwolson <at> gnu.org>

Date: Tue, 2 Apr 2013 08:23:02 UTC

Severity: minor

Tags: notabug

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14121 in the body.
You can then email your comments to 14121 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14121; Package emacs. (Tue, 02 Apr 2013 08:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Olson <mwolson <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 02 Apr 2013 08:23:02 GMT) Full text and rfc822 format available.

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

From: Michael Olson <mwolson <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Fwd: Eager macroexpansion failure in Emacs 24.3
Date: Tue, 2 Apr 2013 09:18:43 +0100
[Message part 1 (text/plain, inline)]
---------- Forwarded message ----------
From: Michael Olson <mwolson <at> gnu.org>
Date: Mon, Apr 1, 2013 at 11:40 AM
Subject: Eager macroexpansion failure in Emacs 24.3
To: Emacs Development Discussions <emacs-devel <at> gnu.org>


emacs --no-init-file --load ~/test-case.el

In *Messages* buffer:

Eager macro-expansion failure: (error "(erc-response\\.contents parsed) is
not a valid place expression")

I can work around this by putting (require 'erc) and the function
definition in different 'when' blocks, but it's not ideal.

The erc-response struct is defined in erc-backend.el, which is loaded by
erc.el.

Putting (require 'erc) inside of a 'when' statement along with code that
relies on functions provided by a struct defined by a file it loads seems
to trigger the problem.

-- 
Michael Olson  |  http://mwolson.org/



-- 
Michael Olson  |  http://mwolson.org/
[Message part 2 (text/html, inline)]
[test-case.el (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14121; Package emacs. (Wed, 03 Apr 2013 18:45:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Olson <mwolson <at> gnu.org>
Cc: 14121 <at> debbugs.gnu.org
Subject: Re: bug#14121: Fwd: Eager macroexpansion failure in Emacs 24.3
Date: Wed, 03 Apr 2013 14:41:34 -0400
tags 14121 notabug
thanks

> emacs --no-init-file --load ~/test-case.el
[...]
> In *Messages* buffer:
[...]
> Eager macro-expansion failure: (error "(erc-response\\.contents parsed) is
> not a valid place expression")

Not a big surprise:

   emacs24 -Q --batch -f batch-byte-compile test-case.el 
   
   In end of data:
   test-case.el:14:1:Warning: the following functions are not known to be
       defined: erc-response.contents, setf, erc-replace-regexp-in-string
   Wrote /home/monnier/tmp/test-case.elc

Emacs-24.3 tries to expand macros more eagerly (i.e. more like the
byte-compiler), so files that fail to byte-compile properly are also
likely to fail that eager macro-expansion.

But do note that the above message is somewhat harmless: when eager
macro-expansion fails, Emacs falls back on macro-expanding lazily as it
has always done.  IOW other than emitting the above message your code
should still work fine.


        Stefan




Added tag(s) notabug. Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> debbugs.gnu.org. (Wed, 03 Apr 2013 18:45:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14121; Package emacs. (Wed, 03 Apr 2013 18:51:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 14121 <at> debbugs.gnu.org, mwolson <at> gnu.org
Subject: Re: bug#14121: Fwd: Eager macroexpansion failure in Emacs 24.3
Date: Wed, 03 Apr 2013 21:47:46 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Date: Wed, 03 Apr 2013 14:41:34 -0400
> Cc: 14121 <at> debbugs.gnu.org
> 
> Emacs-24.3 tries to expand macros more eagerly (i.e. more like the
> byte-compiler), so files that fail to byte-compile properly are also
> likely to fail that eager macro-expansion.
> 
> But do note that the above message is somewhat harmless: when eager
> macro-expansion fails, Emacs falls back on macro-expanding lazily as it
> has always done.

Perhaps the failure message should mention that.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14121; Package emacs. (Wed, 03 Apr 2013 23:45:01 GMT) Full text and rfc822 format available.

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

From: Michael Olson <mwolson <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "14121 <at> debbugs.gnu.org" <14121 <at> debbugs.gnu.org>,
	"mwolson <at> gnu.org" <mwolson <at> gnu.org>,
	Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#14121: Fwd: Eager macroexpansion failure in Emacs 24.3
Date: Thu, 4 Apr 2013 00:41:28 +0100
[Message part 1 (text/plain, inline)]
If the message really is harmless (and no change to the code is
recommended, which seems to be the case), then it really ought to be
removed completely.

On Wednesday, April 3, 2013, Eli Zaretskii wrote:

> > From: Stefan Monnier <monnier <at> iro.umontreal.ca <javascript:;>>
> > Date: Wed, 03 Apr 2013 14:41:34 -0400
> > Cc: 14121 <at> debbugs.gnu.org <javascript:;>
> >
> > Emacs-24.3 tries to expand macros more eagerly (i.e. more like the
> > byte-compiler), so files that fail to byte-compile properly are also
> > likely to fail that eager macro-expansion.
> >
> > But do note that the above message is somewhat harmless: when eager
> > macro-expansion fails, Emacs falls back on macro-expanding lazily as it
> > has always done.
>
> Perhaps the failure message should mention that.
>


-- 
Michael Olson  |  http://mwolson.org/
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14121; Package emacs. (Thu, 04 Apr 2013 00:55:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Olson <mwolson <at> gnu.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>,
	"14121 <at> debbugs.gnu.org" <14121 <at> debbugs.gnu.org>
Subject: Re: bug#14121: Fwd: Eager macroexpansion failure in Emacs 24.3
Date: Wed, 03 Apr 2013 20:51:43 -0400
> If the message really is harmless (and no change to the code is
> recommended, which seems to be the case),

No, the message does mean "you should fix your code".  It's just that we
additionally try to handle it right, for backward compatibility's sake.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14121; Package emacs. (Thu, 04 Apr 2013 03:27:02 GMT) Full text and rfc822 format available.

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

From: Michael Olson <mwolson <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>,
	"14121 <at> debbugs.gnu.org" <14121 <at> debbugs.gnu.org>
Subject: Re: bug#14121: Fwd: Eager macroexpansion failure in Emacs 24.3
Date: Wed, 3 Apr 2013 20:22:31 -0700
[Message part 1 (text/plain, inline)]
What is the "fix" then?  Using a macro in the same 'when' block that the
macro is defined in doesn't seem wrong to me.


On Wed, Apr 3, 2013 at 5:51 PM, Stefan Monnier <monnier <at> iro.umontreal.ca>wrote:

> > If the message really is harmless (and no change to the code is
> > recommended, which seems to be the case),
>
> No, the message does mean "you should fix your code".  It's just that we
> additionally try to handle it right, for backward compatibility's sake.
>
>
>         Stefan
>



-- 
Michael Olson  |  http://mwolson.org/
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14121; Package emacs. (Thu, 04 Apr 2013 12:37:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Olson <mwolson <at> gnu.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>,
	"14121 <at> debbugs.gnu.org" <14121 <at> debbugs.gnu.org>
Subject: Re: bug#14121: Fwd: Eager macroexpansion failure in Emacs 24.3
Date: Thu, 04 Apr 2013 08:33:29 -0400
> What is the "fix" then?

E.g. move the `require' to the top-level.

> Using a macro in the same 'when' block that the
> macro is defined in doesn't seem wrong to me.

It is, because macro expansion can take place (long) before the code is
executed, i.e. long before the macro is defined.


        Stefan




bug closed, send any further explanations to 14121 <at> debbugs.gnu.org and Michael Olson <mwolson <at> gnu.org> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 07 May 2013 07:26:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 04 Jun 2013 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 75 days ago.

Previous Next


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