From 03f3c4376886256bbb7fa71c880e896154490bb3 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 31 Oct 2019 16:49:57 +0100 Subject: [PATCH] update async --- bba.org | 2 +- .../async-autoloads.el | 32 +++------- .../async-bytecomp.el | 61 ++++++++----------- .../async-pkg.el | 2 +- .../async.el | 46 +++++++++----- .../dired-async.el | 0 .../smtpmail-async.el | 0 7 files changed, 67 insertions(+), 76 deletions(-) rename elpa/{async-20181224.454 => async-20191030.2138}/async-autoloads.el (82%) rename elpa/{async-20181224.454 => async-20191030.2138}/async-bytecomp.el (81%) rename elpa/{async-20181224.454 => async-20191030.2138}/async-pkg.el (55%) rename elpa/{async-20181224.454 => async-20191030.2138}/async.el (90%) rename elpa/{async-20181224.454 => async-20191030.2138}/dired-async.el (100%) rename elpa/{async-20181224.454 => async-20191030.2138}/smtpmail-async.el (100%) diff --git a/bba.org b/bba.org index d7b96bb0..e061a167 100644 --- a/bba.org +++ b/bba.org @@ -248,7 +248,7 @@ Keep track of your important stuff! #+BEGIN_SRC emacs-lisp :tangle yes (if (>= emacs-major-version 24) (progn - (add-to-list 'load-path "~/.emacs.d/elpa/async-20181224.454") + (add-to-list 'load-path "~/.emacs.d/elpa/async-201910030.2138") (require 'async) ) ) diff --git a/elpa/async-20181224.454/async-autoloads.el b/elpa/async-20191030.2138/async-autoloads.el similarity index 82% rename from elpa/async-20181224.454/async-autoloads.el rename to elpa/async-20191030.2138/async-autoloads.el index addfab1a..490d7714 100644 --- a/elpa/async-20181224.454/async-autoloads.el +++ b/elpa/async-20191030.2138/async-autoloads.el @@ -1,12 +1,9 @@ ;;; async-autoloads.el --- automatically extracted autoloads ;; ;;; Code: - -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) - +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "async" "async.el" (0 0 0 0)) +;;;### (autoloads nil "async" "async.el" (23994 42607 198271 714000)) ;;; Generated autoloads from async.el (autoload 'async-start-process "async" "\ @@ -69,12 +66,10 @@ returns nil. It can still be useful, however, as an argument to \(fn START-FUNC &optional FINISH-FUNC)" nil nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "async" '("async-"))) - ;;;*** -;;;### (autoloads nil "async-bytecomp" "async-bytecomp.el" (0 0 0 -;;;;;; 0)) +;;;### (autoloads nil "async-bytecomp" "async-bytecomp.el" (23994 +;;;;;; 42607 194086 794000)) ;;; Generated autoloads from async-bytecomp.el (autoload 'async-byte-recompile-directory "async-bytecomp" "\ @@ -107,11 +102,10 @@ Same as `byte-compile-file' but asynchronous. \(fn FILE)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "async-bytecomp" '("async-byte"))) - ;;;*** -;;;### (autoloads nil "dired-async" "dired-async.el" (0 0 0 0)) +;;;### (autoloads nil "dired-async" "dired-async.el" (23994 42607 +;;;;;; 192772 620000)) ;;; Generated autoloads from dired-async.el (defvar dired-async-mode nil "\ @@ -149,19 +143,10 @@ Run ‘dired-do-rename’ asynchronously. \(fn &optional ARG)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "dired-async" '("dired-async-"))) - -;;;*** - -;;;### (autoloads nil "smtpmail-async" "smtpmail-async.el" (0 0 0 -;;;;;; 0)) -;;; Generated autoloads from smtpmail-async.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "smtpmail-async" '("async-smtpmail-"))) - ;;;*** -;;;### (autoloads nil nil ("async-pkg.el") (0 0 0 0)) +;;;### (autoloads nil nil ("async-pkg.el" "smtpmail-async.el") (23994 +;;;;;; 42607 196951 220000)) ;;;*** @@ -169,6 +154,5 @@ Run ‘dired-do-rename’ asynchronously. ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 ;; End: ;;; async-autoloads.el ends here diff --git a/elpa/async-20181224.454/async-bytecomp.el b/elpa/async-20191030.2138/async-bytecomp.el similarity index 81% rename from elpa/async-20181224.454/async-bytecomp.el rename to elpa/async-20191030.2138/async-bytecomp.el index 7bb2d46a..5c8704bc 100644 --- a/elpa/async-20181224.454/async-bytecomp.el +++ b/elpa/async-20191030.2138/async-bytecomp.el @@ -42,14 +42,21 @@ (require 'async) (defcustom async-bytecomp-allowed-packages - '(async helm helm-core helm-ls-git helm-ls-hg magit) + ;; 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 forge 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))) + (unless (memq pkg seen) + (let ((pkg-desc (cadr (or (assq pkg package-archive-contents) + (assq pkg package-alist))))) + (when pkg-desc + (push pkg seen) + (setq pkgs (append (mapcar #'car (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)) diff --git a/elpa/async-20181224.454/async-pkg.el b/elpa/async-20191030.2138/async-pkg.el similarity index 55% rename from elpa/async-20181224.454/async-pkg.el rename to elpa/async-20191030.2138/async-pkg.el index 6e68ac09..a4683ec9 100644 --- a/elpa/async-20181224.454/async-pkg.el +++ b/elpa/async-20191030.2138/async-pkg.el @@ -1,4 +1,4 @@ -(define-package "async" "20181224.454" "Asynchronous processing in Emacs" 'nil :keywords +(define-package "async" "20191030.2138" "Asynchronous processing in Emacs" 'nil :keywords '("async") :url "https://github.com/jwiegley/emacs-async") ;; Local Variables: diff --git a/elpa/async-20181224.454/async.el b/elpa/async-20191030.2138/async.el similarity index 90% rename from elpa/async-20181224.454/async.el rename to elpa/async-20191030.2138/async.el index 771e6410..d616b118 100644 --- a/elpa/async-20181224.454/async.el +++ b/elpa/async-20191030.2138/async.el @@ -37,7 +37,7 @@ "Simple asynchronous processing in Emacs" :group 'emacs) -(defcustom async-variables-noprops-function #'async-variables-noprops +(defcustom async-variables-noprops-function #'async--purecopy "Default function to remove text properties in variables." :group 'async :type 'function) @@ -52,23 +52,39 @@ (defvar async-current-process nil) (defvar async--procvar nil) -(defun async-variables-noprops (sequence) - "Remove text properties in SEQUENCE. +(defun async--purecopy (object) + "Remove text properties in OBJECT. -Argument SEQUENCE may be a list or a string, if anything else it -is returned unmodified. - -Note that this is a naive function that doesn't remove text properties -in SEQUENCE recursively, only at the first level which suffice in most -cases." - (cond ((stringp sequence) - (substring-no-properties sequence)) - ((listp sequence) - (cl-loop for elm in sequence +Argument OBJECT may be a list or a string, if anything else it +is returned unmodified." + (cond ((stringp object) + (substring-no-properties object)) + ((consp object) + (cl-loop for elm in object + ;; A string. if (stringp elm) collect (substring-no-properties elm) - else collect elm)) - (t sequence))) + else + ;; Proper lists. + if (and (consp elm) (null (cdr (last elm)))) + collect (async--purecopy elm) + else + ;; Dotted lists. + ;; We handle here only dotted list where car and cdr + ;; are atoms i.e. (x . y) and not (x . (x . y)) or + ;; (x . (x y)) which should fit most cases. + if (and (consp elm) (cdr (last elm))) + collect (let ((key (car elm)) + (val (cdr elm))) + (cons (if (stringp key) + (substring-no-properties key) + key) + (if (stringp val) + (substring-no-properties val) + val))) + else + collect elm)) + (t object))) (defun async-inject-variables (include-regexp &optional predicate exclude-regexp noprops) diff --git a/elpa/async-20181224.454/dired-async.el b/elpa/async-20191030.2138/dired-async.el similarity index 100% rename from elpa/async-20181224.454/dired-async.el rename to elpa/async-20191030.2138/dired-async.el diff --git a/elpa/async-20181224.454/smtpmail-async.el b/elpa/async-20191030.2138/smtpmail-async.el similarity index 100% rename from elpa/async-20181224.454/smtpmail-async.el rename to elpa/async-20191030.2138/smtpmail-async.el -- 2.47.3