;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; 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. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'ob) #@109 The command location for screen. In case you want to use a different screen than one selected by your $PATH (defvar org-babel-screen-location "screen" (#$ . 423)) #@61 Default arguments to use when running screen source blocks. (defvar org-babel-default-header-args:screen (byte-code "\301\302\303\304\305B\257\207" [null-device (:results . "silent") (:session . "default") (:cmd . "sh") (:terminal . "xterm") :screenrc] 6) (#$ . 592)) #@128 Send a block of code via screen to a terminal using Babel. "default" session is used when none is specified. (fn BODY PARAMS) (defalias 'org-babel-execute:screen #[514 "\300\301!\210\302 \303\304\305\306\307!\310\"\311$\216\312\236A\313!\211\204\"\314\"\210\315\316\"\"\266\202)\207" [message "Sending source code block to interactive terminal session..." current-window-configuration make-byte-code 0 "\301\300!\207" vconcat vector [set-window-configuration] 2 :session org-babel-screen-session-socketname org-babel-prep-session:screen org-babel-screen-session-execute-string org-babel-expand-body:generic] 10 (#$ . 869)]) #@93 Prepare SESSION according to the header arguments specified in PARAMS. (fn SESSION PARAMS) (defalias 'org-babel-prep-session:screen #[514 "\301\236A\302\236A\303\236A\304\236A\305\306Q\307\310\311\312\313 P\314\315 \316\257 %\210\317!?\2057\202-\207" [org-babel-screen-location :session :cmd :terminal :screenrc "org-babel: terminal (" ")" apply start-process "*Messages*" "-T" "org-babel: " "-e" "-c" "-mS" org-babel-screen-session-socketname] 21 (#$ . 1511)]) #@56 If SESSION exists, send BODY to it. (fn SESSION BODY) (defalias 'org-babel-screen-session-execute-string #[514 "\301!\211\205(\302\"\303\304\305\306Q\307\310\311\312\313\314 P\315BBBBBB%\262\207" [org-babel-screen-location org-babel-screen-session-socketname org-babel-screen-session-write-temp-file apply start-process "org-babel: screen (" ")" "*Messages*" "-S" "-X" "eval" "msgwait 0" "readreg z " ("paste z")] 16 (#$ . 1998)]) #@74 Check if SESSION exists by parsing output of "screen -ls". (fn SESSION) (defalias 'org-babel-screen-session-socketname #[257 "\300\301!\302\303\304\305\306\307\"\"\"\302\303\304\310\311\312\313\314\n!\315\"\316\317%\"\"@\211\205)\306!@\207" [shell-command-to-string "screen -ls" delq nil mapcar #[257 "\300\301\"\205\211\207" [string-match "\\(?:(\\(?:\\(?:At\\|De\\)tached)\\)\\)"] 4 "\n\n(fn X)"] split-string "\n" make-byte-code 257 "\302\300!\303\304\305#)\266\203\205\211\207" vconcat vector [inhibit-changing-match-data regexp-quote nil t string-match] 8 "\n\n(fn X)"] 12 (#$ . 2447)]) #@74 Save BODY in a temp file that is named after SESSION. (fn SESSION BODY) (defalias 'org-babel-screen-session-write-temp-file #[514 "\300\301!\211\302\303\304!!\305\306\307\310\311!\312\"\313$\216r\211q\210c\210\314c\210eb\210\315\316!\210)r\211q\210\317\320\211\320\306%\210*\266\211\207" [org-babel-temp-file "screen-" get-buffer-create generate-new-buffer-name " *temp file*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 "\n" delete-matching-lines "^ +$" write-region nil] 11 (#$ . 3061)]) #@71 Test if the default setup works. The terminal should shortly flicker. (defalias 'org-babel-screen-test #[0 "\301\302\303\304!\"\305\306!\307\310\311\260\312\313\"\210\314!\204#\315\316!\210\202\317\320!r\211q\210\321\322\323\324\325!\326\"\327$\216\330!\210ed{*\262\262\331!\210\315\332\333\"\203T\334\202U\335P!\207" [org-babel-default-header-args:screen format "%s" random 99999 org-babel-temp-file "ob-screen-test-" "echo '" "' > " "\nexit\n" nil org-babel-execute:screen file-readable-p message "org-babel-screen: File not readable yet." generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 insert-file-contents-literally delete-file "org-babel-screen: Setup " string-match "WORKS." "DOESN'T work."] 11 (#$ . 3609) nil]) (provide 'ob-screen)