commit | author | age
|
76bbd0
|
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!\210\300\302!\210\300\303!\207" [require ob-core org-compat comint] 2) |
|
16 |
#@70 Check if BUFFER is a comint buffer with a live process. |
|
17 |
|
|
18 |
(fn BUFFER) |
|
19 |
(defalias 'org-babel-comint-buffer-livep #[257 "\211\205 \300!\211\205 \301!\205 \302!\205 \211\207" [get-buffer buffer-live-p get-buffer-process] 4 (#$ . 500)]) |
|
20 |
#@195 Check BUFFER and execute BODY. |
|
21 |
BUFFER is checked with `org-babel-comint-buffer-livep'. BODY is |
|
22 |
executed inside the protection of `save-excursion' and |
|
23 |
`save-match-data'. |
|
24 |
|
|
25 |
(fn BUFFER &rest BODY) |
|
26 |
(defalias 'org-babel-comint-in-buffer '(macro . #[385 "\300\301\302D\303\304EE\305\306\307\310\311BBDEDE\207" [progn unless org-babel-comint-buffer-livep error "Buffer %s does not exist or has no process" save-match-data with-current-buffer save-excursion let ((comint-input-filter (lambda (_input) nil)))] 11 (#$ . 745)])) |
|
27 |
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put org-babel-comint-in-buffer lisp-indent-function 1 put edebug-form-spec (form body)] 5) |
|
28 |
#@517 Evaluate BODY in BUFFER and return process output. |
|
29 |
Will wait until EOE-INDICATOR appears in the output, then return |
|
30 |
all process output. If REMOVE-ECHO and FULL-BODY are present and |
|
31 |
non-nil, then strip echo'd body from the returned output. META |
|
32 |
should be a list containing the following where the last two |
|
33 |
elements are optional. |
|
34 |
|
|
35 |
(BUFFER EOE-INDICATOR REMOVE-ECHO FULL-BODY) |
|
36 |
|
|
37 |
This macro ensures that the filter is removed in case of an error |
|
38 |
or user `keyboard-quit' during execution of body. |
|
39 |
|
|
40 |
(fn META &rest BODY) |
|
41 |
(defalias 'org-babel-comint-with-output '(macro . #[385 "@A@\3008\3018\302\303\304\305\306\307\310\311\312\313\314\315\316\317D\320BB\321BBDDE\322BB\323\324\325\315\326\327\330\331\317\332\333BBDF\334BBF\335BB\336BBBB\"BBBBE\207" [2 3 org-babel-comint-in-buffer let* ((string-buffer #1="") (comint-output-filter-functions (cons (lambda (text) (setq string-buffer (concat string-buffer text))) comint-output-filter-functions)) dangling-text) (goto-char (process-mark (get-buffer-process (current-buffer)))) (let ((start (point)) (end (point-max))) (setq dangling-text (buffer-substring start end)) (delete-region start end)) append while progn (goto-char comint-last-input-end) not save-excursion and re-search-forward regexp-quote (nil t) ((re-search-forward comint-prompt-regexp nil t)) ((accept-process-output (get-buffer-process (current-buffer)))) (goto-char (process-mark (get-buffer-process (current-buffer)))) (insert dangling-text) when string-match replace-regexp-in-string "\n" "[
\n]+" or (#1#) (string-buffer) ((setq string-buffer (substring string-buffer (match-end 0)))) ((split-string string-buffer comint-prompt-regexp))] 29 (#$ . 1429)])) |
|
42 |
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put org-babel-comint-with-output lisp-indent-function 1 put edebug-form-spec (sexp body)] 5) |
|
43 |
#@68 Pass CMD to BUFFER. |
|
44 |
The input will not be echoed. |
|
45 |
|
|
46 |
(fn BUFFER CMD) |
|
47 |
(defalias 'org-babel-comint-input-command #[514 "\301!\204 \302\303\"\210\304 \305\306\307\310\311!\312\"\313$\216rq\210\212\314\315\316!!b\210c\210\317 \210\320!,\207" [comint-input-filter org-babel-comint-buffer-livep error "Buffer %s does not exist or has no process" match-data make-byte-code 0 "\301\300\302\"\207" vconcat vector [set-match-data evaporate] 3 #[257 "\300\207" [nil] 2 "\n\n(fn INPUT)"] process-mark get-buffer-process comint-send-input org-babel-comint-wait-for-output] 9 (#$ . 3277)]) |
|
48 |
#@155 Wait until output arrives from BUFFER. |
|
49 |
Note: this is only safe when waiting for the result of a single |
|
50 |
statement (not large blocks of code). |
|
51 |
|
|
52 |
(fn BUFFER) |
|
53 |
(defalias 'org-babel-comint-wait-for-output #[257 "\303!\204 \304\305\"\210\306 \307\310\311\312\313!\314\"\315$\216rq\210\212\316 b\210\317\n\320\321#\2057 \310\224b\2057 \322\323 !\324\230?\205D \325\326!!\210\202 |