branch: master
commit 40d4f7846df4bac8ad3929c2222eac41b2033933
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>
New mode async-bytecomp-package-mode.
* async-bytecomp.el (async-bytecomp-package-mode): Allow enabling
package--compile
advice with this mode.
---
async-bytecomp.el | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/async-bytecomp.el b/async-bytecomp.el
index 047e605..c103420 100644
--- a/async-bytecomp.el
+++ b/async-bytecomp.el
@@ -131,7 +131,7 @@ All *.elc files are systematically deleted before
proceeding."
(delete-dups
(append async-bytecomp-allowed-packages reqs)))))
-(defadvice package--compile (around byte-compile-async activate)
+(defadvice package--compile (around byte-compile-async)
(let ((cur-package (package-desc-name pkg-desc)))
(if (or (equal async-bytecomp-allowed-packages '(all))
(memq cur-package (async-bytecomp-get-allowed-pkgs)))
@@ -143,6 +143,15 @@ All *.elc files are systematically deleted before
proceeding."
(async-byte-recompile-directory (package-desc-dir pkg-desc) t))
ad-do-it)))
+(define-minor-mode async-bytecomp-package-mode
+ "Byte compile asynchronously packages installed with package.el.
+Async compilation of packages can be controlled by
+`async-bytecomp-allowed-packages'."
+ :group 'async
+ :global t
+ (if async-bytecomp-package-mode
+ (ad-activate 'package--compile)
+ (ad-deactivate 'package--compile)))
(provide 'async-bytecomp)