;ELC   
;;; Compiled
;;; in Emacs version 24.5.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(custom-declare-group 'async nil "Simple asynchronous processing in Emacs" :group 'emacs)
(defvar async-debug nil)
(defvar async-send-over-pipe t)
(defvar async-in-child-emacs nil)
(defvar async-callback nil)
(defvar async-callback-for-process nil)
(defvar async-callback-value nil)
(defvar async-callback-value-set nil)
(defvar async-current-process nil)
#@633 Return a `setq' form that replicates part of the calling environment.
It sets the value for every variable matching INCLUDE-REGEXP and
also PREDICATE.  It will not perform injection for any variable
matching EXCLUDE-REGEXP (if present).  It is intended to be used
as follows:

    (async-start
       `(lambda ()
          (require 'smtpmail)
          (with-temp-buffer
            (insert ,(buffer-substring-no-properties (point-min) (point-max)))
            ;; Pass in the variable environment for smtpmail
            ,(async-inject-variables "\`\(smtpmail\|\(user-\)?mail\)-")
            (smtpmail-send-it)))
       'ignore)
(defalias 'async-inject-variables #[(include-regexp &optional predicate exclude-regexp) "\301\302\303\304!\210)B\207" [bindings setq nil mapatoms #[(sym) "\306!\205: 	\203 \307	\310!\"\205: \307\n\206 \311\310!\"?\205: J\f\203. \f!\2059 \312DBB\211)\207" [sym include-regexp exclude-regexp value predicate bindings boundp string-match symbol-name "-syntax-table\\'" quote] 4]] 3 (#$ . 767)])
(defalias 'async-inject-environment 'async-inject-variables)
(defalias 'async-handle-result #[(func result buf) "\204 \304\302!\210	\304\303!\210\305\211\207\306\216	<\203- 	@\307=\203- \310	A@@	A@A\"\2020 	!)\207" [func result async-callback-value async-callback-value-set make-local-variable t ((byte-code "\204 \302	!\210\302\207" [async-debug buf kill-buffer] 2)) async-signal signal] 3])
#@69 Process sentinal used to retrieve the value from the child process.
(defalias 'async-when-done #[(proc &optional change) "\306!\307=\205h r\310!q\210\311!\312U\203O \n\203? \203. !\f\204g \313p!\210\202g \314\305!\210\314\315!\210\316\211\202g db\210\317 \210\320\321p!p#\202g \314\305!\210\322\323\324\325!\311!#D\314\315!\210\316\211*\207" [proc async-current-process async-callback-for-process async-callback async-debug async-callback-value process-status exit process-buffer process-exit-status 0 kill-buffer make-local-variable async-callback-value-set t backward-sexp async-handle-result read error format "Async process '%s' failed with exit code %d" process-name] 6 (#$ . 2213)])
(defalias 'async--receive-sexp #[(&optional stream) "\303\304\305!!\306\"\n\203 \307\310\311	!\"\210\305	!\n\203# \307\312\311	!\"\210\313	!)\207" [stream sexp async-debug decode-coding-string base64-decode-string read utf-8-unix message "Received sexp {{{%s}}}" pp-to-string "Read sexp {{{%s}}}" eval] 4])
(defalias 'async--insert-sexp #[(sexp) "\303\211\304\np\"\210\305ed\306#\210\307ed\310#\210eb\210\311c\210db\210\311\312\261*\207" [print-length print-level sexp nil prin1 encode-coding-region utf-8-unix base64-encode-region t 34 10] 4])
(defalias 'async--transmit-sexp #[(process sexp) "\304\305!rq\210\306\216	\203 \307\310\311\n!\"\210\312\n!\210\313ed#+\207" [#1=#:temp-buffer async-debug sexp process generate-new-buffer " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#1# buffer-name kill-buffer] 2)) message "Transmitting sexp {{{%s}}}" pp-to-string async--insert-sexp process-send-region] 4])
#@52 Called from the child Emacs process' command-line.
(defalias 'async-batch-invoke #[nil "\305	\211\203 \306\307?\205 \f! !\207\310\311\312\217\207" [async-in-child-emacs async-debug debug-on-error async-send-over-pipe command-line-args-left t prin1 async--receive-sexp err (byte-code "\302\303?\205 	! !\207" [async-send-over-pipe command-line-args-left prin1 async--receive-sexp] 3) ((error (byte-code "\301\302D!\207" [err prin1 async-signal] 3)))] 4 (#$ . 3854)])
#@125 Query a FUTURE to see if the ready is ready -- i.e., if no blocking
would result from a call to `async-get' on that FUTURE.
(defalias 'async-ready #[(future) "\302!\303>\205 r\304!q\210	)\207" [future async-callback-value-set process-status (exit signal) process-buffer] 2 (#$ . 4335)])
#@34 Wait for FUTURE to become ready.
(defalias 'async-wait #[(future) "\301!?\205 \302\303!\210\202  \207" [future async-ready sit-for 0.05] 2 (#$ . 4631)])
#@155 Get the value from an asynchronously function when it is ready.
FUTURE is returned by `async-start' or `async-start-process' when
its FINISH-FUNC is nil.
(defalias 'async-get #[(future) "\302!\210r\303!q\210\304\305	p#)\207" [future async-callback-value async-wait process-buffer async-handle-result identity] 4 (#$ . 4793)])
#@53 Return true of VALUE is an async.el message packet.
(defalias 'async-message-p #[(value) "<\205	 \301\302\"\207" [value plist-get :async-message] 3 (#$ . 5127)])
#@59 Send the given messages to the asychronous Emacs PROCESS.
(defalias 'async-send #[(&rest args) "\303\304\"	\203 \n\205 \n!\202 \305@\306AD\")\207" [args async-in-child-emacs async-callback append (:async-message t) async--transmit-sexp quote] 4 (#$ . 5297)])
#@59 Send the given messages to the asychronous Emacs PROCESS.
(defalias 'async-receive #[(&rest args) "\300 \207" [async--receive-sexp] 1 (#$ . 5570)])
#@326 Start the executable PROGRAM asynchronously.  See `async-start'.
PROGRAM is passed PROGRAM-ARGS, calling FINISH-FUNC with the
process object when done.  If FINISH-FUNC is nil, the future
object will return the process object when the program is
finished.  Set DEFAULT-DIRECTORY to change PROGRAM's current
working directory.
(defalias 'async-start-process #[(name program finish-func &rest program-args) "\306\307\307Q!\310\311\312	\f%)r	q\210\313\314!\210\f\315\316\"\210\317\230\2040 \313\320!\210\321+\207" [name buf process-connection-type program program-args proc generate-new-buffer "*" nil apply start-process make-local-variable async-callback set-process-sentinel async-when-done "emacs" async-callback-for-process t finish-func] 6 (#$ . 5725)])
#@1611 Execute START-FUNC (often a lambda) in a subordinate Emacs process.
When done, the return value is passed to FINISH-FUNC.  Example:

    (async-start
       ;; What to do in the child process
       (lambda ()
         (message "This is a test")
         (sleep-for 3)
         222)

       ;; What to do when it finishes
       (lambda (result)
         (message "Async process done, result should be 222: %s"
                  result)))

If FINISH-FUNC is nil or missing, a future is returned that can
be inspected using `async-get', blocking until the value is
ready.  Example:

    (let ((proc (async-start
                   ;; What to do in the child process
                   (lambda ()
                     (message "This is a test")
                     (sleep-for 3)
                     222))))

        (message "I'm going to do some work here") ;; ....

        (message "Waiting on async process, result should be 222: %s"
                 (async-get proc)))

If you don't want to use a callback, and you don't care about any
return value form the child process, pass the `ignore' symbol as
the second argument (if you don't, and never call `async-get', it
will leave *emacs* process buffers hanging around):

    (async-start
     (lambda ()
       (delete-file "a remote file on a slow link" nil))
     'ignore)

Note: Even when FINISH-FUNC is present, a future is still
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'.
(defalias 'async-start '(macro . #[(start-func &optional finish-func) "\303\304!\210\305\306!\307\310	D\311\312\313\n\314\315\316\317!\320BBBBBBBDD\321\322\323\324BBEF)\207" [procvar start-func finish-func require find-func make-symbol "proc" let* sexp async-start-process "emacs" (file-truename (expand-file-name invocation-name invocation-directory)) "-Q" "-l" locate-library "async" ("-batch" "-f" "async-batch-invoke" (if async-send-over-pipe "<none>" (with-temp-buffer (async--insert-sexp (list 'quote sexp)) (buffer-string)))) if async-send-over-pipe async--transmit-sexp ((list 'quote sexp))] 11 (#$ . 6503)]))
#@59 Evaluate FUNC in a separate Emacs process, synchronously.
(defalias 'async-sandbox '(macro . #[(func) "\301\302DD\207" [func async-get async-start] 3 (#$ . 8741)]))
(provide 'async)
