mirror of https://github.com/Chizi123/.emacs.d.git

Chizi123
2018-11-19 a4b9172aefa91861b587831e06f55b1e19f3f3be
commit | author | age
5cb5f7 1 ;ELC
C 2 ;;; Compiled
3 ;;; in Emacs version 26.1
4 ;;; with all optimizations.
5
6 ;;; This file uses dynamic docstrings, first added in Emacs 19.29.
7
8 ;;; This file does not contain utf-8 non-ASCII characters,
9 ;;; and so can be loaded in Emacs versions earlier than 23.
10
11 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13
14
15 (byte-code "\300\301\302\303\304\305%\210\306\307\310\311\312DD\313\304\301\314\311&\207" [custom-declare-group async nil "Simple asynchronous processing in Emacs" :group emacs custom-declare-variable async-variables-noprops-function funcall function #[0 "\300\207" [async-variables-noprops] 1] "Default function to remove text properties in variables." :type] 8)
16 (defvar async-debug nil)
17 (defvar async-send-over-pipe t)
18 (defvar async-in-child-emacs nil)
19 (defvar async-callback nil)
20 (defvar async-callback-for-process nil)
21 (defvar async-callback-value nil)
22 (defvar async-callback-value-set nil)
23 (defvar async-current-process nil)
24 (defvar async--procvar nil)
25 #@292 Remove text properties in SEQUENCE.
26
27 Argument SEQUENCE may be a list or a string, if anything else it
28 is returned unmodified.
29
30 Note that this is a naive function that doesn't remove text properties
31 in SEQUENCE recursively, only at the first level which suffice in most
32 cases.
33
34 (fn SEQUENCE)
35 (defalias 'async-variables-noprops #[257 "\211;\203    \300!\207\211<\2038\211\301\211:\2035@\262;\203)\300!B\262\202.B\262A\262\202\211\237\207\207" [substring-no-properties nil] 6 (#$ . 1068)])
36 #@888 Return a `setq' form that replicates part of the calling environment.
37
38 It sets the value for every variable matching INCLUDE-REGEXP and
39 also PREDICATE.  It will not perform injection for any variable
40 matching EXCLUDE-REGEXP (if present) or representing a syntax-table
41 i.e. ending by "-syntax-table".
42 When NOPROPS is non nil it tries to strip out text properties of each
43 variable's value with `async-variables-noprops-function'.
44
45 It is intended to be used as follows:
46
47     (async-start
48        `(lambda ()
49           (require 'smtpmail)
50           (with-temp-buffer
51             (insert ,(buffer-substring-no-properties (point-min) (point-max)))
52             ;; Pass in the variable environment for smtpmail
53             ,(async-inject-variables "\`\(smtpmail\|\(user-\)?mail\)-")
54             (smtpmail-send-it)))
55        'ignore)
56
57 (fn INCLUDE-REGEXP &optional PREDICATE EXCLUDE-REGEXP NOPROPS)
58 (defalias 'async-inject-variables #[1025 "\300\301C\302\303\304\305\306\307    \n%\310\"\311\312%!\210\211\242\262B\207" [setq nil mapatoms make-byte-code 257 "\306!\205    \307!\211\205J\205m\300\203\310\300\"\205m\302\203*\310\302\"?\205m\310\311\"?\205m\211;\204M\211\312>\204M\211\247\204M\313!\204M\314D\262\303\203V !\262\301\203`\301!\205m\304\304\242B\240\210\304\304\242B\240\207" vconcat vector [async-variables-noprops-function boundp symbol-name string-match "-syntax-table\\'" (nil t) vectorp quote] 6 "\n\n(fn SYM)"] 17 (#$ . 1579)])
59 (defalias 'async-inject-environment 'async-inject-variables)
60 #@24 
61
62 (fn FUNC RESULT BUF)
63 (defalias 'async-handle-result #[771 "\204\302\300!\210\302\301!\210\303\211\207\304\305\306\307\310!\311\"\312$\216<\2037@\313=\2037\314A@@A@A\"\202:!)\207" [async-callback-value async-callback-value-set make-local-variable t make-byte-code 0 "    ?\205\302\300!\207" vconcat vector [async-debug kill-buffer] 2 async-signal signal] 9 (#$ . 3116)])
64 #@97 Process sentinel used to retrieve the value from the child process.
65
66 (fn PROC &optional CHANGE)
67 (defalias 'async-when-done #[513 "\306!\307=\205gr\310!q\210\311!\312U\203N    \203>\n\203.\n! \204f\313p!\210\202f\314\304!\210\314\305!\210\315\211\202fdb\210\316 \210\317\n\320p!p#\202f\314\304!\210\321\322\323\324!\311!#D\314\305!\210\315\211*\207" [async-current-process async-callback-for-process async-callback async-debug async-callback-value async-callback-value-set process-status exit process-buffer process-exit-status 0 kill-buffer make-local-variable t backward-sexp async-handle-result read error format "Async process '%s' failed with exit code %d" process-name] 8 (#$ . 3509)])
68 #@25 
69
70 (fn &optional STREAM)
71 (defalias 'async--receive-sexp #[256 "\302\303\304!!\305\"\305    \203\306\307\310!\"\210\304!\262    \203%\306\311\310!\"\210\312!)\207" [coding-system-for-write async-debug decode-coding-string base64-decode-string read utf-8-auto message "Received sexp {{{%s}}}" pp-to-string "Read sexp {{{%s}}}" eval] 6 (#$ . 4225)])
72 #@13 
73
74 (fn SEXP)
75 (defalias 'async--insert-sexp #[257 "\304\211\305\211\306p\"\210\307ed\310#\210\311ed\305#\210eb\210\312c\210db\210\312\313\261,\207" [print-circle print-escape-nonascii print-length print-level nil t prin1 encode-coding-region utf-8-auto base64-encode-region 34 10] 5 (#$ . 4581)])
76 #@21 
77
78 (fn PROCESS SEXP)
79 (defalias 'async--transmit-sexp #[514 "\301\302!r\211q\210\303\304\305\306\307!\310\"\311$\216\203\312\313\314!\"\210\315!\210\316ed#*\207" [async-debug generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205    \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 message "Transmitting sexp {{{%s}}}" pp-to-string async--insert-sexp process-send-region] 9 (#$ . 4888)])
80 #@52 Called from the child Emacs process' command-line.
81 (defalias 'async-batch-invoke #[0 "\306\307\n\211\203\310\311\f?\205 ! !\2022\3121+\310\311\f?\205$ ! !0\2022\310\313D!\262)\207" [coding-system-for-write async-in-child-emacs async-debug debug-on-error async-send-over-pipe command-line-args-left utf-8-auto t prin1 async--receive-sexp (error) async-signal] 5 (#$ . 5301)])
82 #@130 Query a FUTURE to see if it is ready.
83
84 I.e., if no blocking
85 would result from a call to `async-get' on that FUTURE.
86
87 (fn FUTURE)
88 (defalias 'async-ready #[257 "\301!\302>\205\303!\304!\203r\211q\210)\202\305\262\207" [async-callback-value-set process-status (exit signal) process-buffer buffer-live-p t] 4 (#$ . 5696)])
89 #@47 Wait for FUTURE to become ready.
90
91 (fn FUTURE)
92 (defalias 'async-wait #[257 "\300!?\205\301\302!\210\202\207" [async-ready sleep-for 0.05] 3 (#$ . 6032)])
93 #@156 Get the value from process FUTURE when it is ready.
94 FUTURE is returned by `async-start' or `async-start-process' when
95 its FINISH-FUNC is nil.
96
97 (fn FUTURE)
98 (defalias 'async-get #[257 "\211\203\301!\210\302!\303!\205r\211q\210\304\305p#)\207" [async-callback-value async-wait process-buffer buffer-live-p async-handle-result identity] 6 (#$ . 6197)])
99 #@65 Return true of VALUE is an async.el message packet.
100
101 (fn VALUE)
102 (defalias 'async-message-p #[257 "\211<\205    \300\301\"\207" [plist-get :async-message] 4 (#$ . 6560)])
103 #@76 Send the given messages to the asychronous Emacs PROCESS.
104
105 (fn &rest ARGS)
106 (defalias 'async-send #[128 "\302\303\"\203    \205    !\202\304@\305AD\"\207" [async-in-child-emacs async-callback append (:async-message t) async--transmit-sexp quote] 6 (#$ . 6735)])
107 #@59 Send the given messages to the asychronous Emacs PROCESS.
108 (defalias 'async-receive #[0 "\300 \207" [async--receive-sexp] 1 (#$ . 7007)])
109 #@376 Start the executable PROGRAM asynchronously.  See `async-start'.
110 PROGRAM is passed PROGRAM-ARGS, calling FINISH-FUNC with the
111 process object when done.  If FINISH-FUNC is nil, the future
112 object will return the process object when the program is
113 finished.  Set DEFAULT-DIRECTORY to change PROGRAM's current
114 working directory.
115
116 (fn NAME PROGRAM FINISH-FUNC &rest PROGRAM-ARGS)
117 (defalias 'async-start-process #[899 "\303\304\304Q!\305\306\307%)rq\210\310\301!\210\311\312\"\210\313\230\204.\310\302!\210\314)\207" [process-connection-type async-callback async-callback-for-process generate-new-buffer "*" nil apply start-process make-local-variable set-process-sentinel async-when-done "emacs" t] 11 (#$ . 7151)])
118 #@198 The Emacs parameter to use to call emacs without config.
119 Can be one of "-Q" or "-q".
120 Default is "-Q" but it is sometimes useful to use "-q" to have a
121 enhanced config or some more variables loaded.
122 (defvar async-quiet-switch "-Q" (#$ . 7885))
123 #@1650 Execute START-FUNC (often a lambda) in a subordinate Emacs process.
124 When done, the return value is passed to FINISH-FUNC.  Example:
125
126     (async-start
127        ;; What to do in the child process
128        (lambda ()
129          (message "This is a test")
130          (sleep-for 3)
131          222)
132
133        ;; What to do when it finishes
134        (lambda (result)
135          (message "Async process done, result should be 222: %s"
136                   result)))
137
138 If FINISH-FUNC is nil or missing, a future is returned that can
139 be inspected using `async-get', blocking until the value is
140 ready.  Example:
141
142     (let ((proc (async-start
143                    ;; What to do in the child process
144                    (lambda ()
145                      (message "This is a test")
146                      (sleep-for 3)
147                      222))))
148
149         (message "I'm going to do some work here") ;; ....
150
151         (message "Waiting on async process, result should be 222: %s"
152                  (async-get proc)))
153
154 If you don't want to use a callback, and you don't care about any
155 return value from the child process, pass the `ignore' symbol as
156 the second argument (if you don't, and never call `async-get', it
157 will leave *emacs* process buffers hanging around):
158
159     (async-start
160      (lambda ()
161        (delete-file "a remote file on a slow link" nil))
162      'ignore)
163
164 Note: Even when FINISH-FUNC is present, a future is still
165 returned except that it yields no value (since the value is
166 passed to FINISH-FUNC).  Call `async-get' on such a future always
167 returns nil.  It can still be useful, however, as an argument to
168 `async-ready' or `async-wait'.
169
170 (fn START-FUNC &optional FINISH-FUNC)
171 (defalias 'async-start #[513 "\306\307\310\311\312    \n\"! \313\314\315!\316\317\320\f\203\321\202;\322\323!r\211q\210\324\325\326\327\330!\331\"\332$\216\333\334 D!\210\335 *\262&\n\f\203I\336 \334D\"\210 )\207" [coding-system-for-read invocation-name invocation-directory async-quiet-switch async-send-over-pipe async--procvar utf-8-auto async-start-process "emacs" file-truename expand-file-name "-l" locate-library "async" "-batch" "-f" "async-batch-invoke" "<none>" generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205    \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 async--insert-sexp quote buffer-string async--transmit-sexp] 20 (#$ . 8135)])
172 #@70 Evaluate FUNC in a separate Emacs process, synchronously.
173
174 (fn FUNC)
175 (defalias 'async-sandbox '(macro . #[257 "\300\301DD\207" [async-get async-start] 4 (#$ . 10470)]))
176 #@26 
177
178 (fn FN FORMS BINDINGS)
179 (defalias 'async--fold-left #[771 "\211\203\211@<\203\202C\"\262A\266\202\202\210\211\207" [] 9 (#$ . 10646)])
180 #@318 Implements `let', but each binding is established asynchronously.
181 For example:
182
183   (async-let ((x (foo))
184               (y (bar)))
185      (message "%s %s" x y))
186
187     expands to ==>
188
189   (async-start (foo)
190    (lambda (x)
191      (async-start (bar)
192       (lambda (y)
193         (message "%s %s" x y)))))
194
195 (fn BINDINGS &rest FORMS)
196 (defalias 'async-let '(macro . #[385 "\300\301\302B\303!#\207" [async--fold-left #[514 "\211A@\300!\203\211\211\262\202\211\301\302E\262\262\303\301@CEE\207" [functionp lambda nil async-start] 8 "\n\n(fn ACC BINDING)"] progn reverse] 7 (#$ . 10806)]))
197 (byte-code "\300\301\302\303#\304\305!\207" [function-put async-let lisp-indent-function 1 provide async] 4)