;ELC ;;; Compiled by heimdall@baldur on Fri Feb 1 18:35:01 2008 ;;; from file /home/heimdall/repos/emms/tq.el ;;; in Emacs version 23.0.60.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`tq.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defalias 'tq-queue #[(tq) "@\207" [tq] 1]) (defalias 'tq-process #[(tq) "A@\207" [tq] 1]) (defalias 'tq-buffer #[(tq) "AA\207" [tq] 1]) (defalias 'tq-queue-head-question #[(tq) "\301!@@\207" [tq tq-queue] 2]) (defalias 'tq-queue-head-regexp #[(tq) "\301!@A@\207" [tq tq-queue] 2]) (defalias 'tq-queue-head-closure #[(tq) "\301!@AA@\207" [tq tq-queue] 2]) (defalias 'tq-queue-head-fn #[(tq) "\301!@AAA\207" [tq tq-queue] 2]) (defalias 'tq-queue-empty #[(tq) "\301!?\207" [tq tq-queue] 2]) #@236 Create and return a transaction queue communicating with PROCESS. PROCESS should be a subprocess capable of sending and receiving streams of bytes. It may be a local process, or it may be connected to a tcp server on another machine. (defalias 'tq-create #[(process) "\302\303\304\305!P!BB\306\307\310\311\312 D\313BBE\"\210 )\207" [process tq nil generate-new-buffer " tq-temp-" process-name set-process-filter lambda (proc string) tq-filter quote (string)] 7 (#$ . 1065)]) (defalias 'tq-queue-add #[(tq question re closure fn) "\305! \n \fBBB\306B\244\240\210\307\207" [tq question re closure fn tq-queue nil ok] 6]) (defalias 'tq-queue-pop #[(tq) "\211@A\240\210\302!\303\304\305\217\210)@?\207" [tq question tq-queue-head-question nil (byte-code "\302\303! \"\207" [tq question process-send-string tq-process] 3) ((error))] 3]) #@566 Add a transaction to transaction queue TQ. This sends the string QUESTION to the process that TQ communicates with. When the corresponding answer comes back, we call FN with two arguments: CLOSURE, which may contain additional data that FN needs, and the answer to the question. REGEXP is a regular expression to match the entire answer; that's how we tell where the answer ends. If DELAY-QUESTION is non-nil, delay sending this question until the process has finished replying to any previous questions. This produces more reliable results with some processes. (defalias 'tq-enqueue #[(tq question regexp closure fn &optional delay-question) "?\206 \306 !?\307 \n?\205 \f \n%\210\n\205\"\310\311 ! \")\207" [delay-question tq sendp question regexp closure tq-queue tq-queue-add process-send-string tq-process fn] 6 (#$ . 1916)]) #@58 Shut down transaction queue TQ, terminating the process. (defalias 'tq-close #[(tq) "\301\302!!\210\303\304!!\207" [tq delete-process tq-process kill-buffer tq-buffer] 3 (#$ . 2762)]) #@62 Append STRING to the TQ's buffer; then process the new data. (defalias 'tq-filter #[(tq string) "\303!\304 !\205r q\210db\210\nc\210\305!))\207" [tq buffer string tq-buffer buffer-live-p tq-process-buffer] 2 (#$ . 2954)]) #@60 Check TQ's buffer for the regexp at the head of the queue. (defalias 'tq-process-buffer #[(tq) "\304!\305 !\205^ q\210\306 \307U?\205^\310!\203=\311\312!\313\ned#\210e`|\210\314\n\315\"\210\316\317\320\321!!\322\n!#)\202^eb\210\323\324!\315\325#\205^e`{e`|\210\326\216\315\327\330\217\210)\331!))\207" [tq buffer buf answer tq-buffer buffer-live-p buffer-size 0 tq-queue-empty generate-new-buffer "*spurious*" copy-to-buffer pop-to-buffer nil error "Spurious communication from process %s, see buffer %s" process-name tq-process buffer-name re-search-forward tq-queue-head-regexp t ((tq-queue-pop tq)) (byte-code "\302!\303! \"\207" [tq answer tq-queue-head-fn tq-queue-head-closure] 3) ((error)) tq-process-buffer] 5 (#$ . 3187)]) (provide 'tq)