GNU bug report logs - #12371
24.2.50; macroexpand-all reporting warnings to *Compile-Log*

Previous Next

Package: emacs;

Reported by: Christopher Schmidt <christopher <at> ch.ristopher.com>

Date: Thu, 6 Sep 2012 13:59:01 UTC

Severity: normal

Merged with 12473

Found in version 24.2.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

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 12371 in the body.
You can then email your comments to 12371 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#12371; Package emacs. (Thu, 06 Sep 2012 13:59:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christopher Schmidt <christopher <at> ch.ristopher.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 06 Sep 2012 13:59:02 GMT) Full text and rfc822 format available.

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

From: Christopher Schmidt <christopher <at> ch.ristopher.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2.50; macroexpand-all reporting warnings to *Compile-Log*
Date: Thu,  6 Sep 2012 14:58:22 +0100 (BST)
emacs -q
M-: (macroexpand-all '(mapc '(lambda ()) nil)) RET

Debugger entered--Lisp error: (void-function byte-compile-log-warning)

emacs -q
M-x load-library RET bytecomp RET
M-: (macroexpand-all '(mapc '(lambda ()) nil)) RET

A *Compile-Log* buffer appears, with the following content

    Warning: (lambda nil ...) quoted with ' rather than with #'

This is utterly confusing.  There is no compilation going on.  (Another
user experience regarding this issue can be found in bug report 12362 -
<87392vtj24.fsf <at> jidanni.org>.)

macroexp--expand-all, which is the originator of the warning, calls
byte-compile-log-warning without consulting byte-compile-warnings.

I think the warning message should include a hint that it was generated
by macroexpanding code and byte-compile-warnings should be consulted as
well.

GNU Emacs 24.2.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of
2012-09-06.

        Christopher




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12371; Package emacs. (Thu, 06 Sep 2012 16:48:01 GMT) Full text and rfc822 format available.

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

From: Christopher Schmidt <christopher <at> ch.ristopher.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#12371: 24.2.50;
	macroexpand-all reporting warnings to *Compile-Log*
Date: Thu,  6 Sep 2012 17:46:53 +0100 (BST)
Christopher Schmidt <christopher <at> ch.ristopher.com> writes:
> I think the warning message should include a hint that it was
> generated by macroexpanding code and byte-compile-warnings should be
> consulted as well.

Other macroexpand warnings are simply messaged (e.g. in
internal-macroexpand-for-load).

        Christopher




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12371; Package emacs. (Wed, 19 Sep 2012 19:13:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 12371 <at> debbugs.gnu.org
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r110098: Partial fix for
	bug#12371
Date: Wed, 19 Sep 2012 15:11:13 -0400
> +(autoload 'byte-compile-warn-obsolete "bytecomp")

Note that byte-compile-warn-obsolete is not called in macroexp.el.
Instead, it's sometimes placed in the output code, where it will either
be ignored (if the code is then interpreted) or run by the
byte-compiler.  So there's no need to autoload it.

The byte-compile-log-warning uses in macroexp.el should use the same
kind of trick to distinguish the "compiling" from the "interpreting" case.
Working on such a fix as we speak,


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12371; Package emacs. (Wed, 19 Sep 2012 20:04:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#12371: 24.2.50;
	macroexpand-all reporting warnings to *Compile-Log*
Date: Wed, 19 Sep 2012 16:01:25 -0400
> macroexp--expand-all, which is the originator of the warning, calls
> byte-compile-log-warning without consulting byte-compile-warnings.

I haven't made such a change yet, but I've modified macroexp.el so that
the message is placed in *Compile-Log* only when byte-compiling.
In other cases it's simply passed to `message'.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12371; Package emacs. (Thu, 20 Sep 2012 01:03:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 12371 <at> debbugs.gnu.org
Subject: macroexp--funcall-if-compiled broke bootstrap for me
Date: Wed, 19 Sep 2012 18:00:49 -0700
The patch in trunk bzr 110102, with this ChangeLog entry:

2012-09-19  Stefan Monnier  <monnier <at> iro.umontreal.ca>

	* emacs-lisp/macroexp.el (macroexp--funcall-if-compiled): Rename from
	macroexp--eval-if-compile.
	(macroexp--funcall-and-return, macroexp--warn-and-return): New funs.
	(macroexp--expand-all): Use them (bug#12371).

broke "make bootstrap" on my platform (Fedora 17, x86-64, GCC 4.7.1).
The failure symptoms are:

make[2]: Entering directory `/home/eggert/src/gnu/emacs/static-checkina/lisp'
Compiling org/ob-awk.el

In toplevel form:
org/ob-awk.el:97:48:Error: Wrong type argument: symbolp, (\, (car form))
make[2]: *** [org/ob-awk.elc] Error 1
make[2]: Leaving directory `/home/eggert/src/gnu/emacs/static-checkina/lisp'

If I start with trunk latest (bzr 110104) and back
out the changes in 110102, the problem goes away.

I see that bug#12371 is still marked as active so I'll
CC: this there.  Macroexpansion is something that makes me
lose too many follicles so I hope someone else can fix this one...




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12371; Package emacs. (Thu, 20 Sep 2012 03:33:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 12371 <at> debbugs.gnu.org
Subject: Re: macroexp--funcall-if-compiled broke bootstrap for me
Date: Wed, 19 Sep 2012 23:30:33 -0400
> 	* emacs-lisp/macroexp.el (macroexp--funcall-if-compiled): Rename from
> 	macroexp--eval-if-compile.
> 	(macroexp--funcall-and-return, macroexp--warn-and-return): New funs.
> 	(macroexp--expand-all): Use them (bug#12371).
[...]
> org/ob-awk.el:97:48:Error: Wrong type argument: symbolp, (\, (car form))

Oops, sorry.  Should be fixed now, thanks,


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12371; Package emacs. (Thu, 20 Sep 2012 04:58:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 12371 <at> debbugs.gnu.org
Subject: Re: macroexp--funcall-if-compiled broke bootstrap for me
Date: Wed, 19 Sep 2012 21:56:23 -0700
On 09/19/2012 08:30 PM, Stefan Monnier wrote:
> Oops, sorry.  Should be fixed now, thanks,

Thanks, it fixed that one, but now I'm getting a different one
with 'make bootstrap':

make[2]: Entering directory `/home/eggert/src/gnu/emacs/static-checking/lisp'
Compiling org/ob-calc.el

In toplevel form:
org/ob-calc.el:30:1:Error: Wrong type argument: stringp, t
make[2]: *** [org/ob-calc.elc] Error 1





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12371; Package emacs. (Thu, 20 Sep 2012 05:14:01 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 12371 <at> debbugs.gnu.org
Subject: Re: macroexp--funcall-if-compiled broke bootstrap for me
Date: Wed, 19 Sep 2012 22:11:41 -0700
On 09/19/2012 09:56 PM, Paul Eggert wrote:
> make[2]: Entering directory `/home/eggert/src/gnu/emacs/static-checking/lisp'
> Compiling org/ob-calc.el

This one appears to be due to the following recent change,
trunk bzr 110109, in the sense that backing out this change
makes the problem go away:

2012-09-20  Stefan Monnier  <monnier <at> iro.umontreal.ca>

	* calc/calc.el: Remove redundant autoload shape check.
	(sel-mode): Don't defvar.
	(calc-get-stack-element): Add `sel-mode' arg instead.
	(calc-top, calc-top-list): Pass it this additional argument.
	* calc/calc-store.el (calc-store-map):
	* calc/calc-map.el (calc-apply, calc-reduce, calc-map)
	(calc-map-equation, calc-outer-product, calc-inner-product):
	* calc/calc-aent.el (calc-alg-entry): Don't bind sel-mode.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12371; Package emacs. (Thu, 20 Sep 2012 08:23:02 GMT) Full text and rfc822 format available.

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

From: Troels Nielsen <bn.troels <at> gmail.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 12371 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#12371: macroexp--funcall-if-compiled broke bootstrap for me
Date: Thu, 20 Sep 2012 10:21:00 +0200
I've run into the same problems this morning, and this patch solves
the problems for me:

The first one I think just is a line gone missing. The next chunk
extracts (car form) before it's to late, as form goes about being
changed before the closure is being called.

Kind Regards
Troels Nielsen

=== modified file 'lisp/calc/calc.el'
--- lisp/calc/calc.el	2012-09-20 03:44:57 +0000
+++ lisp/calc/calc.el	2012-09-20 07:50:18 +0000
@@ -914,9 +914,9 @@

 ;; Set up the autoloading linkage.
 (let ((name (and (fboundp 'calc-dispatch)
-                 (autoloadp (symbol-function 'calc-dispatch))))
+                 (autoloadp (symbol-function 'calc-dispatch))
+                 (nth 1 (symbol-function 'calc-dispatch))))
       (p load-path))
   ;; If Calc files exist on the load-path, we're all set.
   (while (and p (not (file-exists-p
                       (expand-file-name "calc-misc.elc" (car p)))))

=== modified file 'lisp/emacs-lisp/macroexp.el'
--- lisp/emacs-lisp/macroexp.el	2012-09-20 03:29:41 +0000
+++ lisp/emacs-lisp/macroexp.el	2012-09-20 07:51:54 +0000
@@ -148,10 +148,11 @@
                      (car-safe form)
                      (symbolp (car form))
                      (get (car form) 'byte-obsolete-info))
-                (macroexp--funcall-and-return
-                 (lambda () (byte-compile-warn-obsolete (car form)))
-                 #'ignore      ;FIXME: We should `message' something.
-                 new-form)
+                (let ((sym (car form)))
+                  (macroexp--funcall-and-return
+                   (lambda () (byte-compile-warn-obsolete sym))
+                   #'ignore      ;FIXME: We should `message' something.
+                   new-form))
               new-form)))
     (pcase form
       (`(cond . ,clauses)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12371; Package emacs. (Thu, 20 Sep 2012 12:46:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Troels Nielsen <bn.troels <at> gmail.com>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 12371 <at> debbugs.gnu.org
Subject: Re: bug#12371: macroexp--funcall-if-compiled broke bootstrap for me
Date: Thu, 20 Sep 2012 08:43:48 -0400
> I've run into the same problems this morning, and this patch solves
> the problems for me:

> The first one I think just is a line gone missing.

No, I removed that line on purpose (an autoload entry shouldn't have
a nil in position 1, so it should be a redundant test).

> The next chunk extracts (car form) before it's to late, as form goes
> about being changed before the closure is being called.

Duh, sorry 'bout that.  Please install your patch,


        Stefan




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Thu, 20 Sep 2012 14:18:01 GMT) Full text and rfc822 format available.

Notification sent to Christopher Schmidt <christopher <at> ch.ristopher.com>:
bug acknowledged by developer. (Thu, 20 Sep 2012 14:18:01 GMT) Full text and rfc822 format available.

Message #37 received at 12371-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Troels Nielsen <bn.troels <at> gmail.com>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 12371-done <at> debbugs.gnu.org
Subject: Re: bug#12371: macroexp--funcall-if-compiled broke bootstrap for me
Date: Thu, 20 Sep 2012 10:16:12 -0400
>> The first one I think just is a line gone missing.
> No, I removed that line on purpose (an autoload entry shouldn't have
> a nil in position 1, so it should be a redundant test).

That was a brain malfunction, sorry.  Should be fixed now.

>> The next chunk extracts (car form) before it's to late, as form goes
>> about being changed before the closure is being called.
> Duh, sorry 'bout that.  Please install your patch,

I actually installed a different patch instead, which does what your did
plus removes a FIXME.


        Stefan




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

bug unarchived. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 11 Dec 2012 19:31:02 GMT) Full text and rfc822 format available.

Forcibly Merged 12371 12473. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 11 Dec 2012 19:31: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. (Wed, 09 Jan 2013 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 117 days ago.

Previous Next


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