]> git.eshelyaron.com Git - emacs.git/commitdiff
More work to silence the byte-compiler
authorJohn Wiegley <johnw@newartisans.com>
Wed, 18 Mar 2015 08:10:36 +0000 (03:10 -0500)
committerJohn Wiegley <johnw@newartisans.com>
Wed, 18 Mar 2015 08:10:36 +0000 (03:10 -0500)
lisp/use-package/use-package.el

index ab77fd2baf112b1bf8841d2f72acbd68d45a9c61..ade669be483ecbb2bff8baa2f6049385a56a4d52 100644 (file)
@@ -40,6 +40,7 @@
 (require 'bind-key)
 (require 'bytecomp)
 (require 'diminish nil t)
+(require 'bytecomp)
 
 (declare-function package-installed-p 'package)
 
@@ -470,10 +471,13 @@ ARGS is a list of forms, so `((foo))' if only `foo' is being called."
 
      ;; Setup any required autoloads
      (if defer-loading
-         (mapcar #'(lambda (command)
-                     `(unless (fboundp ',command)
-                        (autoload #',command ,name-string nil t)))
-                 commands))
+         (apply
+          #'nconc
+          (mapcar #'(lambda (command)
+                      `((unless (fboundp ',command)
+                          (autoload #',command ,name-string nil t))
+                        (declare-function ,command ,name-string)))
+                  commands)))
 
      (if (numberp deferral)
          `((run-with-idle-timer ,deferral nil #'require ',name-symbol nil t)))
@@ -601,7 +605,9 @@ this file.  Usage:
                         `(featurep ',requires))
                      ,@expansion))))))
         ;; (message "Expanded: %s" (pp-to-string body*))
-        body*))))
+        `(let ((byte-compile-warnings byte-compile-warnings))
+           (byte-compile-disable-warning 'redefined)
+           ,body*)))))
 
 (put 'use-package 'lisp-indent-function 'defun)