]> code.delx.au - gnu-emacs-elpa/commitdiff
Add async to load-path when recompiling itself.
authorThierry Volpiatto <thierry.volpiatto@gmail.com>
Tue, 8 Sep 2015 13:06:26 +0000 (15:06 +0200)
committerThierry Volpiatto <thierry.volpiatto@gmail.com>
Tue, 8 Sep 2015 13:06:26 +0000 (15:06 +0200)
* async-bytecomp.el (package--compile): Do it.

async-bytecomp.el

index dda71f23673e7847571d3ef858ba47ac03d2fabe..f1b29a5769f8bb71df5f2fb7612aff76cfcb700a 100644 (file)
@@ -139,13 +139,17 @@ All *.elc files are systematically deleted before proceeding."
         async-bytecomp-allowed-packages)))
 
 (defadvice package--compile (around byte-compile-async)
-  (let ((cur-package (package-desc-name pkg-desc)))
+  (let ((cur-package (package-desc-name pkg-desc))
+        (pkg-dir (package-desc-dir pkg-desc)))
     (if (or (equal async-bytecomp-allowed-packages '(all))
             (memq cur-package (async-bytecomp-get-allowed-pkgs)))
         (progn
           (when (eq cur-package 'async)
             (fmakunbound 'async-byte-recompile-directory))
-          (load "async-bytecomp") ; emacs-24.3 don't reload new files.
+          (when (and (string= cur-package "async")
+                     (not (member pkg-dir load-path)))
+            (push pkg-dir load-path))
+          (load "async-bytecomp")
           (async-byte-recompile-directory (package-desc-dir pkg-desc) t))
         ad-do-it)))