]> git.eshelyaron.com Git - emacs.git/commitdiff
(byte-compile-eval): Fix test for cl in load-history for absolute file-names.
authorGlenn Morris <rgm@gnu.org>
Tue, 25 Aug 2009 07:28:16 +0000 (07:28 +0000)
committerGlenn Morris <rgm@gnu.org>
Tue, 25 Aug 2009 07:28:16 +0000 (07:28 +0000)
(byte-compile-file-form-require): Warn about use of the cl package.

lisp/ChangeLog
lisp/emacs-lisp/bytecomp.el

index 998daf37a457ca9deada8a800794c1085ce43aa0..e7eba8aeac1e2eeaaddae7a950521d8c23194c75 100644 (file)
@@ -4,6 +4,10 @@
 
 2009-08-25  Glenn Morris  <rgm@gnu.org>
 
+       * emacs-lisp/bytecomp.el (byte-compile-eval): Fix test for cl in
+       load-history for absolute file-names.
+       (byte-compile-file-form-require): Warn about use of the cl package.
+
        * format.el (format-alist): Doc fix.
 
        * play/bubbles.el (top-level): Don't require cl at run-time.
index 4ab701bf55c75d4a1626b22a5739fa4ed8b0a56e..70557d5e247dbff21f8588031cadcf5e2f2fe700 100644 (file)
@@ -902,8 +902,10 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
          (while (and hist-new (not (eq hist-new hist-orig)))
            (let ((xs (pop hist-new)))
              ;; Make sure the file was not already loaded before.
-             (when (and (equal (car xs) "cl") (not (assoc (car xs) hist-orig)))
-               (byte-compile-find-cl-functions)))))))))
+             (and (stringp (car xs))
+                  (string-match "^cl\\>" (file-name-nondirectory (car xs)))
+                  (not (assoc (car xs) hist-orig))
+                  (byte-compile-find-cl-functions)))))))))
 
 (defun byte-compile-eval-before-compile (form)
   "Evaluate FORM for `eval-and-compile'."
@@ -2322,8 +2324,10 @@ list that represents a doc string reference.
   (let ((args (mapcar 'eval (cdr form))))
     (apply 'require args)
     ;; Detect (require 'cl) in a way that works even if cl is already loaded.
-    (if (member (car args) '("cl" cl))
-        (byte-compile-disable-warning 'cl-functions)))
+    (when (member (car args) '("cl" cl))
+      (if (byte-compile-warning-enabled-p 'cl-functions)
+         (byte-compile-warn "cl package required at runtime"))
+      (byte-compile-disable-warning 'cl-functions)))
   (byte-compile-keep-pending form 'byte-compile-normal-call))
 
 (put 'progn 'byte-hunk-handler 'byte-compile-file-form-progn)