branch: master
commit 7625671894ac248de31c55db2bc92ba23078fa35
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>

    Async compile also dependendies (#46).
    
    * async-bytecomp.el (async-bytecomp-get-allowed-pkgs): New.
    (package--compile): Use it.
---
 async-bytecomp.el |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/async-bytecomp.el b/async-bytecomp.el
index 1638fb9..d4b761e 100644
--- a/async-bytecomp.el
+++ b/async-bytecomp.el
@@ -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))

Reply via email to