[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/async f61f1db 60/60: Merge pull request #113 from jwieg
From: |
Stefan Monnier |
Subject: |
[elpa] externals/async f61f1db 60/60: Merge pull request #113 from jwiegley/smonnier_patch |
Date: |
Tue, 8 Oct 2019 10:11:37 -0400 (EDT) |
branch: externals/async
commit f61f1dbf378f1291f90eea98ef8ce4ea2c66197a
Merge: bd68cc1 5e353eb
Author: Thierry Volpiatto <address@hidden>
Commit: GitHub <address@hidden>
Merge pull request #113 from jwiegley/smonnier_patch
Change deps management in async-bytecomp.el
---
async-bytecomp.el | 59 +++++++++++++++++++++++--------------------------------
1 file changed, 25 insertions(+), 34 deletions(-)
diff --git a/async-bytecomp.el b/async-bytecomp.el
index 7bb2d46..d2243b8 100644
--- a/async-bytecomp.el
+++ b/async-bytecomp.el
@@ -42,14 +42,21 @@
(require 'async)
(defcustom async-bytecomp-allowed-packages
+ ;; FIXME: Arguably the default should be `all', but currently
+ ;; this minor mode is silently/forcefully enabled by Helm and Magit to ensure
+ ;; they get compiled asynchronously, so this conservative default value is
+ ;; here to make sure that the mode can be enabled without the user's
+ ;; explicit consent.
'(async helm helm-core helm-ls-git helm-ls-hg magit)
"Packages in this list will be compiled asynchronously by `package--compile'.
All the dependencies of these packages will be compiled async too,
so no need to add dependencies to this list.
-The value of this variable can also be a list with a single element,
-the symbol `all', in this case packages are always compiled asynchronously."
+The value of this variable can also be the symbol `all', in this case
+all packages are always compiled asynchronously."
:group 'async
- :type '(repeat (choice symbol)))
+ :type '(choice
+ (const :tag "All packages" all)
+ (repeat symbol)))
(defvar async-byte-compile-log-file
(concat user-emacs-directory "async-bytecomp.log"))
@@ -109,46 +116,30 @@ All *.elc files are systematically deleted before
proceeding."
(defvar package-alist)
(declare-function package-desc-reqs "package.el" (cl-x))
-(defun async-bytecomp--get-package-deps (pkg &optional only)
+(defun async-bytecomp--get-package-deps (pkgs)
;; Same as `package--get-deps' but parse instead `package-archive-contents'
;; because PKG is not already installed and not present in `package-alist'.
;; However fallback to `package-alist' in case PKG no more present
;; in `package-archive-contents' due to modification to `package-archives'.
;; See issue #58.
- (let* ((pkg-desc (cadr (or (assq pkg package-archive-contents)
- (assq pkg package-alist))))
- (direct-deps (cl-loop for p in (package-desc-reqs pkg-desc)
- for name = (car p)
- when (or (assq name package-archive-contents)
- (assq name package-alist))
- collect name))
- (indirect-deps (unless (eq only 'direct)
- (delete-dups
- (cl-loop for p in direct-deps append
- (async-bytecomp--get-package-deps p))))))
- (cl-case only
- (direct direct-deps)
- (separate (list direct-deps indirect-deps))
- (indirect indirect-deps)
- (t (delete-dups (append direct-deps indirect-deps))))))
-
-(defun async-bytecomp-get-allowed-pkgs ()
- (when (and async-bytecomp-allowed-packages
- (listp async-bytecomp-allowed-packages))
- (if package-archive-contents
- (cl-loop for p in async-bytecomp-allowed-packages
- when (assq p package-archive-contents)
- append (async-bytecomp--get-package-deps p) into reqs
- finally return
- (delete-dups
- (append async-bytecomp-allowed-packages reqs)))
- async-bytecomp-allowed-packages)))
+ (let ((seen '()))
+ (while pkgs
+ (let ((pkg (pop pkgs)))
+ (if (memq pkg seen)
+ nil ;; Done already!
+ (let ((pkg-desc (cadr (or (assq pkg package-archive-contents)
+ (assq pkg package-alist)))))
+ (when pkg-desc
+ (push pkg seen)
+ (setq pkgs (append (package-desc-reqs pkg-desc) pkgs)))))))
+ seen))
(defadvice package--compile (around byte-compile-async)
(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)))
+ (if (or (member async-bytecomp-allowed-packages '(t all (all)))
+ (memq cur-package (async-bytecomp--get-package-deps
+ async-bytecomp-allowed-packages)))
(progn
(when (eq cur-package 'async)
(fmakunbound 'async-byte-recompile-directory))
- [elpa] externals/async 324549b 36/60: Merge pull request #94 from astahlman/auto-select-coding, (continued)
- [elpa] externals/async 324549b 36/60: Merge pull request #94 from astahlman/auto-select-coding, Stefan Monnier, 2019/10/08
- [elpa] externals/async d13c0bc 35/60: Choose coding system based on environment, Stefan Monnier, 2019/10/08
- [elpa] externals/async 890b38f 18/60: Add makefile., Stefan Monnier, 2019/10/08
- [elpa] externals/async afd1ad5 39/60: Allow removing text properties in strings when injecting, Stefan Monnier, 2019/10/08
- [elpa] externals/async 0a56cae 50/60: Update README, Stefan Monnier, 2019/10/08
- [elpa] externals/async b13baeb 47/60: Fix two issues in async-inject-variables, Stefan Monnier, 2019/10/08
- [elpa] externals/async 6fa6a86 49/60: Don't quote numbers as well, Stefan Monnier, 2019/10/08
- [elpa] externals/async caad15c 42/60: Bump to 1.9.3, Stefan Monnier, 2019/10/08
- [elpa] externals/async 373b32a 55/60: Remove props recursively when injecting vars with NOPROPS, Stefan Monnier, 2019/10/08
- [elpa] externals/async 81dc034 54/60: Merge pull request #107 from CeleritasCelery/master, Stefan Monnier, 2019/10/08
- [elpa] externals/async f61f1db 60/60: Merge pull request #113 from jwiegley/smonnier_patch,
Stefan Monnier <=
- [elpa] externals/async 5e353eb 59/60: Change deps management in async-bytecomp.el, Stefan Monnier, 2019/10/08
- [elpa] externals/async 29e6144 07/60: Allow non list bindings in async-let., Stefan Monnier, 2019/10/08
- [elpa] externals/async d17c11e 51/60: Add more info about emacs bug when using async, Stefan Monnier, 2019/10/08
- [elpa] externals/async 7df4b68 40/60: Merge branch 'master' of github.com:jwiegley/emacs-async, Stefan Monnier, 2019/10/08
- [elpa] externals/async 6c9c3a2 17/60: Update README.md, Stefan Monnier, 2019/10/08
- [elpa] externals/async e5e636c 19/60: Update version number., Stefan Monnier, 2019/10/08
- [elpa] externals/async ea83ef5 23/60: Use emacs -q flag to fix issue #80 with emacs-26, Stefan Monnier, 2019/10/08
- [elpa] externals/async 87853ae 29/60: Allow backing up in same directory, Stefan Monnier, 2019/10/08
- [elpa] externals/async 424ecd8 32/60: Fix compilation warning, Stefan Monnier, 2019/10/08
- [elpa] externals/async 15bcbf6 37/60: Use user-emacs-directory (#95), Stefan Monnier, 2019/10/08