GNU bug report logs -
#14831
cl-member warnings during bootstrap
Previous Next
Reported by: Juanma Barranquero <lekktu <at> gmail.com>
Date: Tue, 9 Jul 2013 14:43:02 UTC
Severity: normal
Found in version 24.3.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 14831 in the body.
You can then email your comments to 14831 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#14831
; Package
emacs
.
(Tue, 09 Jul 2013 14:43:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juanma Barranquero <lekktu <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 09 Jul 2013 14:43:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Package: emacs
Version: 24.3.50
During bootstrap, there are two cl-member related warnings:
In end of data:
international/mule-cmds.el:2981:1:Warning: the function `cl-member' is not
known to be defined.
In end of data:
replace.el:2338:1:Warning: the function `cl-member' is not known to be
defined.
and indeed, mule-cmds.elc and replace.elc contain references to
cl-member. Recompiling these files after bootstrap removes these
references.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#14831
; Package
emacs
.
(Tue, 09 Jul 2013 15:55:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 14831 <at> debbugs.gnu.org (full text, mbox):
Juanma Barranquero wrote:
> In end of data:
> international/mule-cmds.el:2981:1:Warning: the function `cl-member' is not
> known to be defined.
>
> In end of data:
> replace.el:2338:1:Warning: the function `cl-member' is not known to be
> defined.
It is not a real problem. It is due to
(or (load "cl-loaddefs" 'noerror 'quiet)
;; When bootstrapping, cl-loaddefs hasn't been built yet!
(require 'cl-macs))
Loading cl-seq as well as cl-macs would make it go away.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#14831
; Package
emacs
.
(Tue, 09 Jul 2013 15:57:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 14831 <at> debbugs.gnu.org (full text, mbox):
On Tue, Jul 9, 2013 at 5:54 PM, Glenn Morris <rgm <at> gnu.org> wrote:
> It is not a real problem. It is due to
OK.
> Loading cl-seq as well as cl-macs would make it go away.
Any reason not to do so?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#14831
; Package
emacs
.
(Mon, 15 Jul 2013 11:38:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 14831 <at> debbugs.gnu.org (full text, mbox):
On Tue, Jul 9, 2013 at 5:54 PM, Glenn Morris <rgm <at> gnu.org> wrote:
> It is not a real problem. It is due to
>
> (or (load "cl-loaddefs" 'noerror 'quiet)
> ;; When bootstrapping, cl-loaddefs hasn't been built yet!
> (require 'cl-macs))
>
> Loading cl-seq as well as cl-macs would make it go away.
Hmm. I added (require 'cl-seq), bootstrapped, and the cl-member
warnings didn't go away.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#14831
; Package
emacs
.
(Mon, 15 Jul 2013 16:11:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 14831 <at> debbugs.gnu.org (full text, mbox):
Juanma Barranquero wrote:
>> Loading cl-seq as well as cl-macs would make it go away.
>
> Hmm. I added (require 'cl-seq), bootstrapped, and the cl-member
> warnings didn't go away.
Works for me (after changing cl-seq to provide itself).
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#14831
; Package
emacs
.
(Mon, 15 Jul 2013 16:25:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 14831 <at> debbugs.gnu.org (full text, mbox):
On Mon, Jul 15, 2013 at 6:10 PM, Glenn Morris <rgm <at> gnu.org> wrote:
> Works for me (after changing cl-seq to provide itself).
Well, are you going to install the change, then, or is there any downside?
J
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#14831
; Package
emacs
.
(Mon, 15 Jul 2013 19:49:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 14831 <at> debbugs.gnu.org (full text, mbox):
Juanma Barranquero wrote:
> Well, are you going to install the change, then, or is there any downside?
I think it's up to Stefan, who authored the current state.
AFAIK, the warnings are harmless. Loading extra files slows down the
build by some fractional amount (that's the only downside I can see).
So maybe he prefers to leave it as-is.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#14831
; Package
emacs
.
(Mon, 15 Jul 2013 19:52:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 14831 <at> debbugs.gnu.org (full text, mbox):
> I think it's up to Stefan, who authored the current state.
> AFAIK, the warnings are harmless. Loading extra files slows down the
> build by some fractional amount (that's the only downside I can see).
> So maybe he prefers to leave it as-is.
OK, thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#14831
; Package
emacs
.
(Tue, 16 Jul 2013 00:20:01 GMT)
Full text and
rfc822 format available.
Message #29 received at 14831 <at> debbugs.gnu.org (full text, mbox):
>> Well, are you going to install the change, then, or is there any downside?
> I think it's up to Stefan, who authored the current state.
> AFAIK, the warnings are harmless. Loading extra files slows down the
> build by some fractional amount (that's the only downside I can see).
> So maybe he prefers to leave it as-is.
It might be worth checking the impact on the bootstrap time.
I'd like to understand exactly where those `cl-member's come from.
I suspect the missing part is the (put 'cl-member 'compiler-macro
#'cl--compiler-macro-member) which is normally in cl-loaddefs.el.
Those residual cl-member calls may actually be a real problem, so maybe
this is not just a minor cosmetic fix.
Stefan "who can't dig into it further now"
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#14831
; Package
emacs
.
(Tue, 16 Jul 2013 01:38:01 GMT)
Full text and
rfc822 format available.
Message #32 received at 14831 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier wrote:
> I'd like to understand exactly where those `cl-member's come from.
> I suspect the missing part is the (put 'cl-member 'compiler-macro
> #'cl--compiler-macro-member) which is normally in cl-loaddefs.el.
>
> Those residual cl-member calls may actually be a real problem, so maybe
> this is not just a minor cosmetic fix.
Deleting cl-loadefs.el and batch byte-compiling a file with sole contents:
(defvar foo-bar nil)
(add-to-list 'foo-bar 1)
produces byte-code containing cl-member. Makes no sense to me...
You are correct that adding
(eval-and-compile (put 'cl-member 'compiler-macro#'cl--compiler-macro-member))
to the start of the file seems to fix it.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#14831
; Package
emacs
.
(Tue, 16 Jul 2013 08:58:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 14831 <at> debbugs.gnu.org (full text, mbox):
>> I'd like to understand exactly where those `cl-member's come from.
>> I suspect the missing part is the (put 'cl-member 'compiler-macro
>> #'cl--compiler-macro-member) which is normally in cl-loaddefs.el.
>>
>> Those residual cl-member calls may actually be a real problem, so maybe
>> this is not just a minor cosmetic fix.
> Deleting cl-loadefs.el and batch byte-compiling a file with sole contents:
> (defvar foo-bar nil)
> (add-to-list 'foo-bar 1)
> produces byte-code containing cl-member. Makes no sense to me...
Aha! So it's the compiler-macro of add-to-list which turns an
add-to-list call into a cl-pushnew call, which is then macro-expanded to
something that uses cl-member, which should be turned into a plain
`member' by `cl--compiler-macro-member'. So it can be fixed by changing
the compiler-macro of add-to-list not to use cl-pushnew.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#14831
; Package
emacs
.
(Tue, 16 Jul 2013 17:13:01 GMT)
Full text and
rfc822 format available.
Message #38 received at 14831 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier wrote:
> Aha! So it's the compiler-macro of add-to-list which turns an
> add-to-list call into a cl-pushnew call, which is then macro-expanded to
> something that uses cl-member, which should be turned into a plain
> `member' by `cl--compiler-macro-member'. So it can be fixed by changing
> the compiler-macro of add-to-list not to use cl-pushnew.
Or move the
(put 'cl-member 'compiler-macro #'cl--compiler-macro-member)
from cl-seq to cl-macs (and probably the same for cl-assoc).
That seems fine to me, since that is where cl--compiler-macro-member is
defined, but I guess you might want to keep that statement where
cl-member is defined instead.
Reply sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
You have taken responsibility.
(Mon, 22 Jul 2013 20:41:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Juanma Barranquero <lekktu <at> gmail.com>
:
bug acknowledged by developer.
(Mon, 22 Jul 2013 20:41:05 GMT)
Full text and
rfc822 format available.
Message #43 received at 14831-done <at> debbugs.gnu.org (full text, mbox):
>> Aha! So it's the compiler-macro of add-to-list which turns an
>> add-to-list call into a cl-pushnew call, which is then macro-expanded to
>> something that uses cl-member, which should be turned into a plain
>> `member' by `cl--compiler-macro-member'. So it can be fixed by changing
>> the compiler-macro of add-to-list not to use cl-pushnew.
I installed the patch below which tightens things up a bit.
Stefan
=== modified file 'lisp/subr.el'
--- lisp/subr.el 2013-07-19 12:18:16 +0000
+++ lisp/subr.el 2013-07-22 16:46:55 +0000
@@ -1498,9 +1498,10 @@
;; FIXME: Something like this could be used for `set' as well.
(if (or (not (eq 'quote (car-safe list-var)))
(special-variable-p (cadr list-var))
- (and append compare-fn))
+ (not (macroexp-const-p append)))
exp
(let* ((sym (cadr list-var))
+ (append (eval append))
(msg (format "`add-to-list' can't use lexical var `%s'; use `push' or `cl-pushnew'"
sym))
;; Big ugly hack so we only output a warning during
@@ -1513,13 +1514,17 @@
(when (assq sym byte-compile--lexical-environment)
(byte-compile-log-warning msg t :error))))
(code
- (if append
(macroexp-let2 macroexp-copyable-p x element
- `(unless (member ,x ,sym)
- (setq ,sym (append ,sym (list ,x)))))
+ `(unless ,(if compare-fn
+ (progn
(require 'cl-lib)
- `(cl-pushnew ,element ,sym
- :test ,(or compare-fn '#'equal)))))
+ `(cl-member ,x ,sym :test ,compare-fn))
+ ;; For bootstrapping reasons, don't rely on
+ ;; cl--compiler-macro-member for the base case.
+ `(member ,x ,sym))
+ ,(if append
+ `(setq ,sym (append ,sym (list ,x)))
+ `(push ,x ,sym))))))
(if (not (macroexp--compiling-p))
code
`(progn
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 20 Aug 2013 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 11 years and 308 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.