]> code.delx.au - gnu-emacs-elpa/commitdiff
Async compile also dependendies (#46).
authorThierry Volpiatto <thierry.volpiatto@gmail.com>
Tue, 30 Dec 2014 06:18:22 +0000 (07:18 +0100)
committerThierry Volpiatto <thierry.volpiatto@gmail.com>
Tue, 30 Dec 2014 06:18:22 +0000 (07:18 +0100)
* async-bytecomp.el (async-bytecomp-get-allowed-pkgs): New.
(package--compile): Use it.

async-bytecomp.el

index 1638fb9463a45bf1b394bc3050aa7820f4b547a1..d4b761ec76031346ff5765e3ae5ae7550e30b660 100644 (file)
@@ -99,9 +99,20 @@ All *.elc files are systematically deleted before proceeding."
      call-back)
     (message "Started compiling asynchronously directory %s" directory)))
 
+(defvar package-archive-contents)
+(declare-function package-desc-reqs "package.el" (cl-x))
+
+(defun async-bytecomp-get-allowed-pkgs ()
+  (cl-loop for p in async-bytecomp-allowed-packages
+           for pkg-desc = (car (assoc-default p package-archive-contents))
+           append (mapcar 'car (package-desc-reqs pkg-desc)) into reqs
+           finally return
+           (cl-remove-duplicates
+            (append async-bytecomp-allowed-packages reqs))))
+
 (defadvice package--compile (around byte-compile-async activate)
   (let ((cur-package (package-desc-name pkg-desc)))
-    (if (memq cur-package async-bytecomp-allowed-packages)
+    (if (memq cur-package (async-bytecomp-get-allowed-pkgs))
         (progn
           (when (eq cur-package 'async)
             (fmakunbound 'async-byte-recompile-directory))