GNU bug report logs - #14831
cl-member warnings during bootstrap

Previous Next

Package: emacs;

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.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Juanma Barranquero <lekktu <at> gmail.com>
Subject: bug#14831: closed (Re: bug#14831: cl-member warnings during
 bootstrap)
Date: Mon, 22 Jul 2013 20:41:05 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#14831: cl-member warnings during bootstrap

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 14831 <at> debbugs.gnu.org.

-- 
14831: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14831
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Juanma Barranquero <lekktu <at> gmail.com>, 14831-done <at> debbugs.gnu.org
Subject: Re: bug#14831: cl-member warnings during bootstrap
Date: Mon, 22 Jul 2013 16:40:27 -0400
>> 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


[Message part 3 (message/rfc822, inline)]
From: Juanma Barranquero <lekktu <at> gmail.com>
To: Bug-Gnu-Emacs <bug-gnu-emacs <at> gnu.org>
Subject: cl-member warnings during bootstrap
Date: Tue, 9 Jul 2013 16:42:03 +0200
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.



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.