emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master d250e7b 139/187: Allow customizing which packages compile


From: Michael Albinus
Subject: [elpa] master d250e7b 139/187: Allow customizing which packages compile async (#46).
Date: Wed, 30 Dec 2015 11:50:13 +0000

branch: master
commit d250e7bd2ccad3f5a5c37de9774cc91cf57afdc9
Author: Thierry Volpiatto <address@hidden>
Commit: Thierry Volpiatto <address@hidden>

    Allow customizing which packages compile async (#46).
    
    * async-bytecomp.el (async-bytecomp-allowed-packages): New user var.
    (package--compile): Use it.
---
 async-bytecomp.el |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/async-bytecomp.el b/async-bytecomp.el
index 7e682f6..1638fb9 100644
--- a/async-bytecomp.el
+++ b/async-bytecomp.el
@@ -42,6 +42,11 @@
 (require 'cl-lib)
 (require 'async)
 
+(defcustom async-bytecomp-allowed-packages '(async helm)
+  "Packages in this list will be compiled asynchronously by 
`package--compile'."
+  :group 'async
+  :type '(repeat (choice symbol)))
+
 (defvar async-byte-compile-log-file "~/.emacs.d/async-bytecomp.log")
 
 (defun async-byte-recompile-directory (directory &optional quiet)
@@ -95,11 +100,16 @@ All *.elc files are systematically deleted before 
proceeding."
     (message "Started compiling asynchronously directory %s" directory)))
 
 (defadvice package--compile (around byte-compile-async activate)
-  (when (eq (package-desc-name pkg-desc) 'async)
-    (fmakunbound 'async-byte-recompile-directory))
-  (package-activate-1 pkg-desc)
-  (load "async-bytecomp") ; emacs-24.3 don't reload new files.
-  (async-byte-recompile-directory (package-desc-dir pkg-desc) t))
+  (let ((cur-package (package-desc-name pkg-desc)))
+    (if (memq cur-package async-bytecomp-allowed-packages)
+        (progn
+          (when (eq cur-package 'async)
+            (fmakunbound 'async-byte-recompile-directory))
+          (package-activate-1 pkg-desc)
+          (load "async-bytecomp") ; emacs-24.3 don't reload new files.
+          (async-byte-recompile-directory (package-desc-dir pkg-desc) t))
+        ad-do-it)))
+
 
 (provide 'async-bytecomp)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]