From 4d38407b36d763b72d7bd68505db5938c54b52ad Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 24 Dec 2015 17:45:34 +0100 Subject: [PATCH] updating async. --- bba.org | 62 +++++++++---------- elpa/async-20150529.529/async-pkg.el | 4 -- .../async-autoloads.el | 12 ++-- .../async-bytecomp.el | 30 ++++++--- elpa/async-20151123.256/async-pkg.el | 7 +++ .../async.el | 15 ++--- .../dired-async.el | 37 ++++++----- .../smtpmail-async.el | 4 +- elpa/async-readme.txt | 3 + 9 files changed, 101 insertions(+), 73 deletions(-) delete mode 100644 elpa/async-20150529.529/async-pkg.el rename elpa/{async-20150529.529 => async-20151123.256}/async-autoloads.el (94%) rename elpa/{async-20150529.529 => async-20151123.256}/async-bytecomp.el (85%) create mode 100644 elpa/async-20151123.256/async-pkg.el rename elpa/{async-20150529.529 => async-20151123.256}/async.el (96%) rename elpa/{async-20150529.529 => async-20151123.256}/dired-async.el (91%) rename elpa/{async-20150529.529 => async-20151123.256}/smtpmail-async.el (96%) create mode 100644 elpa/async-readme.txt diff --git a/bba.org b/bba.org index b9270424..df03fcbe 100644 --- a/bba.org +++ b/bba.org @@ -158,7 +158,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-20150529.529") + (add-to-list 'load-path "~/.emacs.d/elpa/async-20151123.256") (require 'async) ) ) @@ -754,47 +754,47 @@ Very useful for repetitive literate devops jobs. #+BEGIN_SRC emacs-lisp - ;; (setq org-clock-persist 'history) - (org-clock-persistence-insinuate) - (setq org-clock-persist t) - (setq org-default-notes-file (concat org-directory "/refile.org")) - (define-key global-map "\C-cc" 'org-capture) + ;; (setq org-clock-persist 'history) + (org-clock-persistence-insinuate) + (setq org-clock-persist t) + (setq org-default-notes-file (concat org-directory "/refile.org")) + (define-key global-map "\C-cc" 'org-capture) - (setq org-capture-templates + (setq org-capture-templates - '(("t" "todo" entry (file+headline "~/org/refile.org" "Tasks") - "* TODO %^{Task}\n%U\n + '(("t" "todo" entry (file+headline "~/org/refile.org" "Tasks") + "* TODO %^{Task}\n%U\n - %i\n - %a\n - %? - ") + %i\n + %a\n + %? + ") - ("m" "Meeting" entry (file "~/org/refile.org") - "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t) + ("m" "Meeting" entry (file "~/org/refile.org") + "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t) - ("n" "note" entry (file+headline "~/org/refile.org" "Note") - "* NOTE %?\n%U\n + ("n" "note" entry (file+headline "~/org/refile.org" "Note") + "* NOTE %?\n%U\n - %i\n - %a") + %i\n + %a") - ("w" "work todo" (file+headline "~/workorg/work.org" "todolist") - "* TODO %{Task}\n%U\n + ("w" "work todo" entry (file+headline "~/workorg/work.org" "Tasks") + "* TODO %^{Task}\n%U\n - %i\n - %a\n - %?" - ) + %i\n + %a\n + %? + ") - ("j" "Journal" entry (file+datetree "~/git/org/diary.org") - "* %?\n%U\n" :clock-in t :clock-resume t) + ("j" "Journal" entry (file+datetree "~/git/org/diary.org") + "* %?\n%U\n" :clock-in t :clock-resume t) - ("l" "Links (it)" entry (file+headline "~/org/refile.org" "Links") - "** %c\n\n %u\n %i" - :empty-lines 1) + ("l" "Links (it)" entry (file+headline "~/org/refile.org" "Links") + "** %c\n\n %u\n %i" + :empty-lines 1) - )) + )) #+END_SRC diff --git a/elpa/async-20150529.529/async-pkg.el b/elpa/async-20150529.529/async-pkg.el deleted file mode 100644 index da89a153..00000000 --- a/elpa/async-20150529.529/async-pkg.el +++ /dev/null @@ -1,4 +0,0 @@ -(define-package "async" "20150529.529" "Asynchronous processing in Emacs" 'nil) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/async-20150529.529/async-autoloads.el b/elpa/async-20151123.256/async-autoloads.el similarity index 94% rename from elpa/async-20150529.529/async-autoloads.el rename to elpa/async-20151123.256/async-autoloads.el index 683bece4..c3002567 100644 --- a/elpa/async-20150529.529/async-autoloads.el +++ b/elpa/async-20151123.256/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" (21908 14300 0 0)) +;;;### (autoloads nil "async" "async.el" (22140 8226 0 0)) ;;; Generated autoloads from async.el (autoload 'async-start-process "async" "\ @@ -68,8 +68,8 @@ returns nil. It can still be useful, however, as an argument to ;;;*** -;;;### (autoloads nil "async-bytecomp" "async-bytecomp.el" (21908 -;;;;;; 14300 0 0)) +;;;### (autoloads nil "async-bytecomp" "async-bytecomp.el" (22140 +;;;;;; 8226 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" (21908 14300 +;;;### (autoloads nil "dired-async" "dired-async.el" (22140 8226 ;;;;;; 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") (21908 -;;;;;; 14300 316611 0)) +;;;### (autoloads nil nil ("async-pkg.el" "smtpmail-async.el") (22140 +;;;;;; 8226 463061 0)) ;;;*** diff --git a/elpa/async-20150529.529/async-bytecomp.el b/elpa/async-20151123.256/async-bytecomp.el similarity index 85% rename from elpa/async-20150529.529/async-bytecomp.el rename to elpa/async-20151123.256/async-bytecomp.el index 00043472..53d288da 100644 --- a/elpa/async-20150529.529/async-bytecomp.el +++ b/elpa/async-20151123.256/async-bytecomp.el @@ -42,7 +42,8 @@ (require 'cl-lib) (require 'async) -(defcustom async-bytecomp-allowed-packages '(async helm) +(defcustom async-bytecomp-allowed-packages + '(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. @@ -108,6 +109,8 @@ All *.elc files are systematically deleted before proceeding." (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))) (direct-deps (cl-loop for p in (package-desc-reqs pkg-desc) for name = (car p) @@ -126,21 +129,30 @@ All *.elc files are systematically deleted before proceeding." (defun async-bytecomp-get-allowed-pkgs () (when (and async-bytecomp-allowed-packages (listp async-bytecomp-allowed-packages)) - (cl-loop for p in async-bytecomp-allowed-packages - append (async-bytecomp--get-package-deps p) into reqs - finally return - (delete-dups - (append async-bytecomp-allowed-packages reqs))))) + (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))) (defadvice package--compile (around byte-compile-async) - (let ((cur-package (package-desc-name pkg-desc))) + (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))) (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. + ;; Add to `load-path' the latest version of async and + ;; reload it when reinstalling async. + (when (string= cur-package "async") + (cl-pushnew pkg-dir load-path) + (load "async-bytecomp")) + ;; `async-byte-recompile-directory' will add directory + ;; as needed to `load-path'. (async-byte-recompile-directory (package-desc-dir pkg-desc) t)) ad-do-it))) diff --git a/elpa/async-20151123.256/async-pkg.el b/elpa/async-20151123.256/async-pkg.el new file mode 100644 index 00000000..16c98c65 --- /dev/null +++ b/elpa/async-20151123.256/async-pkg.el @@ -0,0 +1,7 @@ +(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-20150529.529/async.el b/elpa/async-20151123.256/async.el similarity index 96% rename from elpa/async-20150529.529/async.el rename to elpa/async-20151123.256/async.el index be9c04e5..e41b39de 100644 --- a/elpa/async-20150529.529/async.el +++ b/elpa/async-20151123.256/async.el @@ -1,4 +1,4 @@ -;;; async --- Asynchronous processing in Emacs +;;; async.el --- Asynchronous processing in Emacs ;; Copyright (C) 2012~2014 John Wiegley @@ -128,12 +128,13 @@ as follows: (eval sexp))) (defun async--insert-sexp (sexp) - (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) - (base64-encode-region (point-min) (point-max) t) - (goto-char (point-min)) (insert ?\") - (goto-char (point-max)) (insert ?\" ?\n)) + (let (print-level print-length) + (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) + (base64-encode-region (point-min) (point-max) t) + (goto-char (point-min)) (insert ?\") + (goto-char (point-max)) (insert ?\" ?\n))) (defun async--transmit-sexp (process sexp) (with-temp-buffer diff --git a/elpa/async-20150529.529/dired-async.el b/elpa/async-20151123.256/dired-async.el similarity index 91% rename from elpa/async-20150529.529/dired-async.el rename to elpa/async-20151123.256/dired-async.el index d37c5cb1..3f5349da 100644 --- a/elpa/async-20150529.529/dired-async.el +++ b/elpa/async-20151123.256/dired-async.el @@ -27,15 +27,15 @@ ;;; Commentary: ;; This file provide a redefinition of `dired-create-file' function, -;; which must be loaded *after* dired-aux.el, performs copies, -;; moves and all what is handled by `dired-create-file' in the background -;; using a slave Emacs process, by means of the async.el module. +;; performs copies, moves and all what is handled by `dired-create-file' +;; in the background using a slave Emacs process, +;; by means of the async.el module. ;; To use it, put this in your .emacs: -;; -;; (eval-after-load "dired-aux" -;; '(require 'dired-async)) -;; -;; + +;; (dired-async-mode 1) + +;; This will enable async copy/rename etc... +;; in dired and helm. ;;; Code: @@ -74,7 +74,7 @@ Should take same args as `message'." :group 'dired-async) (defface dired-async-mode-message - '((t (:background "Firebrick1"))) + '((t (:foreground "Gold"))) "Face used for `dired-async--modeline-mode' lighter." :group 'dired-async) @@ -151,10 +151,11 @@ Should take same args as `message'." See `dired-create-files' for the behavior of arguments." (setq dired-async-operation nil) - (let (dired-create-files-failures failures async-fn-list - skipped (success-count 0) (total (length fn-list)) - (callback `(lambda (&optional ignore) - (dired-async-after-file-create ,(length fn-list))))) + (let (dired-create-files-failures + failures async-fn-list + skipped (success-count 0) + (total (length fn-list)) + callback) (let (to overwrite-query overwrite-backup-query) ; for dired-handle-overwrite (dolist (from fn-list) @@ -215,7 +216,15 @@ ESC or `q' to not overwrite any of the remaining files, (push (dired-make-relative from) failures) (dired-log "%s `%s' to `%s' failed" operation from to))) - (push (cons from to) async-fn-list)))))) + (push (cons from to) async-fn-list))))) + (setq callback + `(lambda (&optional ignore) + (dired-async-after-file-create ,total) + (when (string= ,(downcase operation) "rename") + (cl-loop for (file . to) in ',async-fn-list + do (and (get-file-buffer file) + (with-current-buffer (get-file-buffer file) + (set-visited-file-name to nil t)))))))) ;; Handle error happening in host emacs. (cond (dired-create-files-failures diff --git a/elpa/async-20150529.529/smtpmail-async.el b/elpa/async-20151123.256/smtpmail-async.el similarity index 96% rename from elpa/async-20150529.529/smtpmail-async.el rename to elpa/async-20151123.256/smtpmail-async.el index d487f930..99c4017b 100644 --- a/elpa/async-20150529.529/smtpmail-async.el +++ b/elpa/async-20151123.256/smtpmail-async.el @@ -1,4 +1,4 @@ -;;; smtpmail-async --- Send e-mail with smtpmail.el asynchronously +;;; smtpmail-async.el --- Send e-mail with smtpmail.el asynchronously ;; Copyright (C) 2012~2014 John Wiegley @@ -61,7 +61,7 @@ It is called just before calling `smtpmail-send-it'.") (set-buffer-multibyte nil) ;; Pass in the variable environment for smtpmail ,(async-inject-variables - "\\`\\(smtpmail\\|async-smtpmail\\|\\(user-\\)?mail\\)-\\|auth-sources" + "\\`\\(smtpmail\\|async-smtpmail\\|\\(user-\\)?mail\\)-\\|auth-sources\\|epg" nil "\\`\\(mail-header-format-function\\|smtpmail-address-buffer\\|mail-mode-abbrev-table\\)") (run-hooks 'async-smtpmail-before-send-hook) (smtpmail-send-it))) diff --git a/elpa/async-readme.txt b/elpa/async-readme.txt new file mode 100644 index 00000000..3e6a4fef --- /dev/null +++ b/elpa/async-readme.txt @@ -0,0 +1,3 @@ +Adds the ability to call asynchronous functions and process with ease. See +the documentation for `async-start' and `async-start-process'. + -- 2.47.3