From f4428b58b1166d2662eb89684bf282537a634bd7 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Sat, 20 Feb 2016 13:01:48 +0100 Subject: [PATCH] update async. --- bba.org | 2 +- elpa/async-20151123.256/async-pkg.el | 7 -- .../async-autoloads.el | 14 +-- .../async-bytecomp.el | 13 ++- elpa/async-20160108.1249/async-pkg.el | 6 ++ .../async.el | 86 +++++++++++-------- .../dired-async.el | 3 +- .../smtpmail-async.el | 2 +- 8 files changed, 73 insertions(+), 60 deletions(-) delete mode 100644 elpa/async-20151123.256/async-pkg.el rename elpa/{async-20151123.256 => async-20160108.1249}/async-autoloads.el (93%) rename elpa/{async-20151123.256 => async-20160108.1249}/async-bytecomp.el (93%) create mode 100644 elpa/async-20160108.1249/async-pkg.el rename elpa/{async-20151123.256 => async-20160108.1249}/async.el (85%) rename elpa/{async-20151123.256 => async-20160108.1249}/dired-async.el (99%) rename elpa/{async-20151123.256 => async-20160108.1249}/smtpmail-async.el (97%) diff --git a/bba.org b/bba.org index 1f96039b..372e0aac 100644 --- a/bba.org +++ b/bba.org @@ -199,7 +199,7 @@ Keep track of your important stuff! #+BEGIN_SRC emacs-lisp (if (>= emacs-major-version 24) (progn - (add-to-list 'load-path "~/.emacs.d/elpa/async-20151123.256") + (add-to-list 'load-path "~/.emacs.d/elpa/async-20160108.1249") (require 'async) ) ) diff --git a/elpa/async-20151123.256/async-pkg.el b/elpa/async-20151123.256/async-pkg.el deleted file mode 100644 index 16c98c65..00000000 --- a/elpa/async-20151123.256/async-pkg.el +++ /dev/null @@ -1,7 +0,0 @@ -(define-package "async" "20151123.256" "Asynchronous processing in Emacs" - '((emacs "24") - (cl-lib "0.5")) - :url "https://github.com/jwiegley/emacs-async") -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/async-20151123.256/async-autoloads.el b/elpa/async-20160108.1249/async-autoloads.el similarity index 93% rename from elpa/async-20151123.256/async-autoloads.el rename to elpa/async-20160108.1249/async-autoloads.el index c3002567..cb44251c 100644 --- a/elpa/async-20151123.256/async-autoloads.el +++ b/elpa/async-20160108.1249/async-autoloads.el @@ -3,7 +3,7 @@ ;;; Code: (add-to-list 'load-path (or (file-name-directory #$) (car load-path))) -;;;### (autoloads nil "async" "async.el" (22140 8226 0 0)) +;;;### (autoloads nil "async" "async.el" (22215 9106 0 0)) ;;; Generated autoloads from async.el (autoload 'async-start-process "async" "\ @@ -64,12 +64,12 @@ passed to FINISH-FUNC). Call `async-get' on such a future always returns nil. It can still be useful, however, as an argument to `async-ready' or `async-wait'. -\(fn START-FUNC &optional FINISH-FUNC)" nil t) +\(fn START-FUNC &optional FINISH-FUNC)" nil nil) ;;;*** -;;;### (autoloads nil "async-bytecomp" "async-bytecomp.el" (22140 -;;;;;; 8226 0 0)) +;;;### (autoloads nil "async-bytecomp" "async-bytecomp.el" (22215 +;;;;;; 9106 0 0)) ;;; Generated autoloads from async-bytecomp.el (autoload 'async-byte-recompile-directory "async-bytecomp" "\ @@ -96,7 +96,7 @@ Async compilation of packages can be controlled by ;;;*** -;;;### (autoloads nil "dired-async" "dired-async.el" (22140 8226 +;;;### (autoloads nil "dired-async" "dired-async.el" (22215 9106 ;;;;;; 0 0)) ;;; Generated autoloads from dired-async.el @@ -116,8 +116,8 @@ Do dired actions asynchronously. ;;;*** -;;;### (autoloads nil nil ("async-pkg.el" "smtpmail-async.el") (22140 -;;;;;; 8226 463061 0)) +;;;### (autoloads nil nil ("async-pkg.el" "smtpmail-async.el") (22215 +;;;;;; 9106 560243 0)) ;;;*** diff --git a/elpa/async-20151123.256/async-bytecomp.el b/elpa/async-20160108.1249/async-bytecomp.el similarity index 93% rename from elpa/async-20151123.256/async-bytecomp.el rename to elpa/async-20160108.1249/async-bytecomp.el index 53d288da..54313c0e 100644 --- a/elpa/async-20151123.256/async-bytecomp.el +++ b/elpa/async-20160108.1249/async-bytecomp.el @@ -1,7 +1,6 @@ ;;; async-bytecomp.el --- Async functions to compile elisp files async -;; Copyright (C) 2014 John Wiegley -;; Copyright (C) 2014 Thierry Volpiatto +;; Copyright (C) 2014-2016 Free Software Foundation, Inc. ;; Authors: John Wiegley ;; Thierry Volpiatto @@ -106,15 +105,21 @@ All *.elc files are systematically deleted before proceeding." (unless quiet (message "Started compiling asynchronously directory %s" directory)))) (defvar package-archive-contents) +(defvar package-alist) (declare-function package-desc-reqs "package.el" (cl-x)) (defun async-bytecomp--get-package-deps (pkg &optional only) ;; Same as `package--get-deps' but parse instead `package-archive-contents' ;; because PKG is not already installed and not present in `package-alist'. - (let* ((pkg-desc (cadr (assq pkg package-archive-contents))) + ;; 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 (assq name package-archive-contents) + when (or (assq name package-archive-contents) + (assq name package-alist)) collect name)) (indirect-deps (unless (eq only 'direct) (delete-dups diff --git a/elpa/async-20160108.1249/async-pkg.el b/elpa/async-20160108.1249/async-pkg.el new file mode 100644 index 00000000..b0420406 --- /dev/null +++ b/elpa/async-20160108.1249/async-pkg.el @@ -0,0 +1,6 @@ +(define-package "async" "20160108.1249" "Asynchronous processing in Emacs" 'nil :keywords + '("async") + :url "http://elpa.gnu.org/packages/async.html") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/async-20151123.256/async.el b/elpa/async-20160108.1249/async.el similarity index 85% rename from elpa/async-20151123.256/async.el rename to elpa/async-20160108.1249/async.el index e41b39de..24db2a1e 100644 --- a/elpa/async-20151123.256/async.el +++ b/elpa/async-20160108.1249/async.el @@ -1,9 +1,10 @@ ;;; async.el --- Asynchronous processing in Emacs -;; Copyright (C) 2012~2014 John Wiegley +;; Copyright (C) 2012-2016 Free Software Foundation, Inc. ;; Author: John Wiegley ;; Created: 18 Jun 2012 +;; Version: 1.6 ;; Keywords: async ;; X-URL: https://github.com/jwiegley/emacs-async @@ -42,6 +43,7 @@ (defvar async-callback-value nil) (defvar async-callback-value-set nil) (defvar async-current-process nil) +(defvar async--procvar nil) (defun async-inject-variables (include-regexp &optional predicate exclude-regexp) @@ -119,7 +121,9 @@ as follows: (defun async--receive-sexp (&optional stream) (let ((sexp (decode-coding-string (base64-decode-string - (read stream)) 'utf-8-unix))) + (read stream)) 'utf-8-unix)) + ;; Parent expects UTF-8 encoded text. + (coding-system-for-write 'utf-8-unix)) (if async-debug (message "Received sexp {{{%s}}}" (pp-to-string sexp))) (setq sexp (read sexp)) @@ -128,7 +132,10 @@ as follows: (eval sexp))) (defun async--insert-sexp (sexp) - (let (print-level print-length) + (let (print-level + print-length + (print-escape-nonascii t) + (print-circle t)) (prin1 sexp (current-buffer)) ;; Just in case the string we're sending might contain EOF (encode-coding-region (point-min) (point-max) 'utf-8-unix) @@ -145,18 +152,21 @@ as follows: (defun async-batch-invoke () "Called from the child Emacs process' command-line." - (setq async-in-child-emacs t - debug-on-error async-debug) - (if debug-on-error - (prin1 (funcall - (async--receive-sexp (unless async-send-over-pipe - command-line-args-left)))) - (condition-case err - (prin1 (funcall - (async--receive-sexp (unless async-send-over-pipe - command-line-args-left)))) - (error - (prin1 (list 'async-signal err)))))) + ;; Make sure 'message' and 'prin1' encode stuff in UTF-8, as parent + ;; process expects. + (let ((coding-system-for-write 'utf-8-unix)) + (setq async-in-child-emacs t + debug-on-error async-debug) + (if debug-on-error + (prin1 (funcall + (async--receive-sexp (unless async-send-over-pipe + command-line-args-left)))) + (condition-case err + (prin1 (funcall + (async--receive-sexp (unless async-send-over-pipe + command-line-args-left)))) + (error + (prin1 (list 'async-signal err))))))) (defun async-ready (future) "Query a FUTURE to see if the ready is ready -- i.e., if no blocking @@ -214,7 +224,7 @@ working directory." proc))) ;;;###autoload -(defmacro async-start (start-func &optional finish-func) +(defun async-start (start-func &optional finish-func) "Execute START-FUNC (often a lambda) in a subordinate Emacs process. When done, the return value is passed to FINISH-FUNC. Example: @@ -261,28 +271,28 @@ returned except that it yields no value (since the value is passed to FINISH-FUNC). Call `async-get' on such a future always returns nil. It can still be useful, however, as an argument to `async-ready' or `async-wait'." - (require 'find-func) - (let ((procvar (make-symbol "proc"))) - `(let* ((sexp ,start-func) - (,procvar - (async-start-process - "emacs" (file-truename - (expand-file-name invocation-name - invocation-directory)) - ,finish-func - "-Q" "-l" - ;; Using `locate-library' ensure we use the right file - ;; when the .elc have been deleted. - ,(locate-library "async") - "-batch" "-f" "async-batch-invoke" - (if async-send-over-pipe - "" - (with-temp-buffer - (async--insert-sexp (list 'quote sexp)) - (buffer-string)))))) - (if async-send-over-pipe - (async--transmit-sexp ,procvar (list 'quote sexp))) - ,procvar))) + (let ((sexp start-func) + ;; Subordinate Emacs will send text encoded in UTF-8. + (coding-system-for-read 'utf-8-unix)) + (setq async--procvar + (async-start-process + "emacs" (file-truename + (expand-file-name invocation-name + invocation-directory)) + finish-func + "-Q" "-l" + ;; Using `locate-library' ensure we use the right file + ;; when the .elc have been deleted. + (locate-library "async") + "-batch" "-f" "async-batch-invoke" + (if async-send-over-pipe + "" + (with-temp-buffer + (async--insert-sexp (list 'quote sexp)) + (buffer-string))))) + (if async-send-over-pipe + (async--transmit-sexp async--procvar (list 'quote sexp))) + async--procvar)) (defmacro async-sandbox(func) "Evaluate FUNC in a separate Emacs process, synchronously." diff --git a/elpa/async-20151123.256/dired-async.el b/elpa/async-20160108.1249/dired-async.el similarity index 99% rename from elpa/async-20151123.256/dired-async.el rename to elpa/async-20160108.1249/dired-async.el index 3f5349da..ecab9cb5 100644 --- a/elpa/async-20151123.256/dired-async.el +++ b/elpa/async-20160108.1249/dired-async.el @@ -1,7 +1,6 @@ ;;; dired-async.el --- Copy/move/delete asynchronously in dired. -;; Copyright (C) 2012~2014 John Wiegley -;; Copyright (C) 2012~2014 Thierry Volpiatto +;; Copyright (C) 2012-2016 Free Software Foundation, Inc. ;; Authors: John Wiegley ;; Thierry Volpiatto diff --git a/elpa/async-20151123.256/smtpmail-async.el b/elpa/async-20160108.1249/smtpmail-async.el similarity index 97% rename from elpa/async-20151123.256/smtpmail-async.el rename to elpa/async-20160108.1249/smtpmail-async.el index 99c4017b..5ac426d6 100644 --- a/elpa/async-20151123.256/smtpmail-async.el +++ b/elpa/async-20160108.1249/smtpmail-async.el @@ -1,6 +1,6 @@ ;;; smtpmail-async.el --- Send e-mail with smtpmail.el asynchronously -;; Copyright (C) 2012~2014 John Wiegley +;; Copyright (C) 2012-2016 Free Software Foundation, Inc. ;; Author: John Wiegley ;; Created: 18 Jun 2012 -- 2.47.3