;ELC ;;; compiled by cthomp@willow on Fri Sep 3 14:43:40 1993 ;;; from file /export/willow0/era-working/editor/lisp/ilisp/comint-ipc.el ;;; emacs version 19.8 (beta12) Lucid. ;;; bytecomp version 2.18; 28-aug-93. ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "This file was compiled for Emacs 19.")) (byte-code "! $$" [boundp epoch::version autoload popper-scroll-output "epoch-pop" "" t "popper"] 5) (defvar comint-log nil "\ If T, then record all process input and output in a buffer called process name.") (defvar comint-send-newline t "\ If T then add a newline to string in comint-default-send.") (defvar comint-always-scroll nil "\ If T then process output will always be visible in first window on buffer.") (defvar comint-fix-error nil "\ String to send to send to the command interpreter to fix errors.") (defvar comint-continue nil "\ String to send to continue an interrupted job.") (defvar comint-interrupt-regexp nil "\ Regular expression for the start of an interrupt in process output.") (defvar comint-error-regexp nil "\ Regular expression for setting comint-errorp if found in process output.") (defvar comint-output-buffer " *Output*" "\ Name of the output buffer.") (defvar comint-error-buffer " *Error Output*" "\ Name of the error output buffer.") (defvar comint-show-status t "\ Set to nil to inhibit status redisplay.") (defvar comint-output-filter 'identity "\ Given the complete OUTPUT of a send, return the result of the send.") (defvar comint-interrupt-start 'comint-interrupt-start "\ Return the start in OUTPUT of the text printed by comint-interrupt-subjob in the inferior process.") (defvar comint-handler 'comint-error-popup "\ Default handler for sends. When a send completes, the handler is called with error-p, wait-p, message, output and prompt.") (defvar comint-update-status 'comint-update-status "\ Function to update the STATUS of the inferior process. It should set comint-status to a status string in addition to whatever else it does.") (defvar comint-prompt-status 'comint-prompt-status "\ Given the previous prompt and the last line output, return 'error if an error, T if a prompt and nil otherwise. If it is a prompt, also funcall comint-update-status to set the status. If old is nil, then just return T if last line is a prompt.") (defvar comint-abort-hook nil "\ List of hooks to run after sends are aborted.") (defvar comint-send-queue nil "\ List of currently pending IPC send requests. The first element in the queue is where output to the process will be stored. A send record is a list of: string -- The string sent to the process. no-insert -- nil to insert output into the process buffer. If this is being done, the results will only contain the very last line. wait-p -- nil if not waiting, non-nil if waiting. If it is a string, results are inserted in the buffer until a result matches the string as a regexp. status -- A symbol for the process status while the send is running. message -- A message to be displayed when an asynchronous send is popped up by the handler. handler -- A function that given error-p, wait-p, message, output and prompt decides if the user should be notified. If it is nil or returns nil, then no error processing will be done. running -- nil if a send is waiting, T if it is running, another send if interrupting and a string with pending output if the send was interrupted. old-prompt -- The prompt before the send was sent. If it is nil, then errors will not be detected. line -- The start of the last line in the results. result -- Cons of the output and the prompt after the send.") (defvar comint-end-queue nil "\ Pointer to the end of comint-send-queue.") (defvar comint-queue-emptied t "\ Set to T each time send queue empties.") (defvar comint-output nil "\ Set to the output of the last send. This is useful when ilisp code is put in the send stream.") (defvar comint-errorp nil "\ Set to T if the last send was an error.") (defvar comint-status " :run" "\ The current comint status.") (defvar comint-original-buffer nil "\ The original buffer when there was output to a comint buffer.") (defvar comint-last-send nil "\ Last send that was put in queue.") (defvar comint-aborting nil "\ Set to T if we are aborting commands.") (fset 'comint-remove-whitespace #[(string) "\"ÔÉ #Õt O*" [string string-match "[^ \n]" 0 start end "[ \n]*[^ \n]+"] 5 "\ Remove leading and trailing whitespace in STRING."]) (fset 'comint-log #[(process string &optional output) " !!qdb cccc)" [comint-log get-buffer-create process-name process output "{" string "}"] 3 "\ Log to PROCESS, STRING marking as optional OUTPUT."]) (fset 'comint-send-string #[(proc str) " \n\"\nG ^ \n O\" W \\ \n ^O\")b*" [comint-log proc str len comint-input-chunk-size i process-send-string 0 next-i accept-process-output] 7 "\ Send PROCESS the contents of STRING as input. This is equivalent to process-send-string, except that long input strings are broken up into chunks of size comint-input-chunk-size. Processes are given a chance to output between chunks. This can help prevent processes from hanging when you send them long inputs on some OS's."]) (fset 'comint-sender #[(process string) " \n\" \" \"" [comint-send-string process string comint-send-newline comint-log "\n" process-send-string] 3 "\ Send to PROCESS STRING with newline if comint-send-newline."]) (fset 'comint-interrupt-subjob #[nil "p!\" \"" [comint-log get-buffer-process "" interrupt-process nil comint-ptyp] 3 "\ Interrupt the current subjob." nil]) (fset 'comint-send-variables #[(send) "AAAAAA" [send] 1 "\ Return a pointer to the start of the variables for SEND. It returns (running old-prompt line (output . prompt))."]) (fset 'comint-send-results #[(send) " !AAA@" [comint-send-variables send] 2 "\ Return the results of SEND which are (output . prompt). If there is an error, the prompt will be a list."]) (fset 'comint-send-description #[(send) "AAAA@@;@ @ @!)" [send status symbol-name] 3 "\ Return a description of SEND."]) (fset 'comint-interrupted #[nil " \n @!@;n Ak\n*" [comint-send-queue nil done send comint-send-variables t] 3 "\ Return T if there is an interrupted send."]) (fset 'comint-process-sentinel #[(process status) " ! !! !q \n!)" [process-status process status buffer-name process-buffer comint-update-status] 3 "\ Update PROCESS STATUS by funcalling comint-update-status."]) (fset 'comint-interrupt-start #[(output) "\n\"Ô" [comint-interrupt-regexp string-match output 0] 3 "\ Return the start of comint-interrupt-regexp in OUTPUT."]) (fset 'comint-update-status #[(status) "\n\" q)!" [format " :%s" status comint-status comint-show-status other-buffer sit-for 0] 3 "\ Update the process STATUS of the current buffer."]) (fset 'comint-prompt-status #[(old line &optional equal) " \n\" \n\" ? \n = ! )" [string-match comint-prompt-regexp line equal old error comint-update-status ready] 3 "\ Called by comint-process filter with OLD and LINE, return 'error if LINE is an error, T if it is a prompt as determined by comint-prompt-regexp or nil otherwise. Also set the status appropriately by funcalling comint-update-status. If specified EQUAL will be called with old and line and should return T if line is not an error. OLD will be nil for the first prompt."]) (fset 'comint-insert #[(output) "p ! !  ! =` U ! bc `ȓ)  b`\"? !!!*-" [output buffer get-buffer-process process process-mark mark selected-window window nil at-end window-buffer get-buffer-window comint-always-scroll pos-visible-in-window-p original select-window recenter (center)] 3 "\ Insert process OUTPUT into the current buffer."]) (fset 'comint-handle-error #[(output prompt keys &optional delay) "! !q\"!!r !! !! >U e ]," [delay 1 beep t comint-display-error output comint-original-buffer sit-for nil execute-kbd-macro read-key-sequence get-buffer-window get-buffer comint-error-buffer 0 char echo-keystrokes cursor-in-echo-area message prompt read-char keys 32 popper-scroll-output quit-flag] 3 "\ Handle an error by beeping, displaying OUTPUT and then waiting for the user to pause. Once there is pause, PROMPT until one of the characters in KEYS is typed. If optional DELAY is specified, it is the number of seconds that the user must pause. The key found will be returned."]) (fset 'comint-error-popup #[(error wait-p message output prompt) " q\n\ncc c!)Ƈ" [error comint-output-buffer message 10 output beep t] 3 "\ If there is an ERROR pop up a window with MESSAGE and OUTPUT. Nothing is done with PROMPT or WAIT-P."]) (fset 'comint-process-filter #[(process output) " p !q @ A\nA AA A AAAA@@\n@\n @ @ ; # !bn)\"=ڕOP@@#ڕm\n!@@Oڠ@:@!@  !@O@@Oڠ))@:w@@O\"#@\"\"$\n%@@O! @ $=&@&\"C\"@'&('('\")  ) \"% ,ۡ*!! !=q." [t inhibit-quit selected-window window process-buffer process comint-original-buffer match-data comint-send-queue send no-insert wait-p messagep handler running old-prompt line result old-result message sync comint-log output process-mark string-match "[ ]*\n" 0 nil "\n" comint-insert comint-interrupt-start split interrupted comint-send-variables last comint-prompt-status is-prompt comint-output-filter error comint-output comint-error-regexp comint-errorp ((byte-code " \n ʼnʼnB\n A B \n  \"@AAAAР\n O ȕOP! @OРŠ!)РŠ!Ň" [error handler no-insert comint-fix-error t nil fix "Fixing error" 0 comint-send-queue sync string-match wait-p old-result match comint-end-queue "Done" comint-insert result line messagep running comint-dispatch-send process] 12)) store-match-data get-buffer-window window-buffer minibuffer-window] 7 "\ Filter PROCESS OUTPUT. See comint-send for more information. The first element of the comint-send-queue is the current send entry. If the entry has a nil no-insert flag, insert the results into the process buffer. If the send is an interrupt, comint-interrupt-start is funcalled on the output and should return the start of the output of an interrupt. comint-prompt-status is called with the old prompt and the last line. It should return 'error if the last line is an error, T if it is a prompt and nil otherwise. It should also update the process status by funcalling comint-update-status. If there is a send handler, it is called with (error-p wait-p message output prompt) and should determine what sort of notification is appropriate and return T if errors should be fixed and NIL otherwise. If the prompt is an error, then comint-fix-error will be sent to fix the error. When there is a prompt in the output stream, the next send will be dispatched unless the wait flag for the send is a string. If it is a string, then results will be discarded until one matches the string as a regexp. Output to the process should only be done through the functions comint-send or comint-default-send, or results will be mixed up."]) (fset 'comint-dispatch-send #[(process) "@ !A = @ !\n !A : @ ˠ @; AAA@!\"@\"ɠ*| A@ @!A = @ AAAA@@@ ! ˠ; !@;ڰ!;@! : @  !z@;@ !@ݘɠ !\"\"\"ˠˉˉB\nB!) !A : @ ɠ\".\n+" [comint-send-queue send comint-send-results results prompt comint-end-queue comint-send-variables running init t comint-queue-emptied nil comint-update-status comint-sender process comint-continue comint-process-filter top-level string no-insert wait-p status message comint-insert comment-start comment-end "\n" comint-dispatch-send output "" comint-fix-error fix "Fixing error" 0] 12 "\ Dispatch the next send in PROCESS comint-send-queue, popping the current send if done."]) (fset 'comint-interrupt #[(process send) " @AA@ @\nÉB\n BB ! *  = @ BB  AB" [comint-continue comint-send-queue current nil t interrupt "Interrupt" 0 send comint-update-status comint-interrupt-subjob comint-end-queue] 12 "\ Interrupt PROCESS to send SEND if comint-continue is defined and the current send is not waiting. Otherwise, SEND will be the next send."]) (fset 'comint-setup-ipc #[(&optional force) "!!!!!!!!!!!!!!!!!! ԉԉB\nC  p!\"\")щ" [make-local-variable comint-send-newline comint-always-scroll comint-fix-error comint-continue comint-interrupt-regexp comint-error-regexp comint-output-filter comint-interrupt-start comint-handler comint-update-status comint-prompt-status comint-send-queue comint-end-queue comint-queue-emptied comint-output comint-errorp comint-status comint-aborting force nil run "Top Level" t 0 get-buffer-process process set-process-filter comint-process-filter set-process-sentinel comint-process-sentinel mode-line-process] 12 "\ Setup for IPC in the current buffer. If called interactively, force comint-send-queue to be initialized." "p"]) (fset 'comint-send #[(process string &optional no-insert wait status message handler after) " !q  \n=?\n ̉̉B\n!=@@!A;B ! \"@=ABA\\B*ߎ=A !r. " [process-buffer process t inhibit-quit string no-insert wait status run message handler comint-handler nil 0 send comint-send-results pointer comint-send-queue comint-end-queue top-level end current prompt ok comint-aborting comint-dispatch-send after comint-interrupt next looking comint-last-send ((byte-code " \n@= !A@ÉB\n\nAB ) \n\"Ç" [ok send comint-send-queue nil t interrupt "Interrupt" comint-send-variables comint-interrupt-subjob delq] 12)) accept-process-output sit-for] 11 "\ Do a send to PROCESS of STRING. Optionally specify NO-INSERT, WAIT, STATUS, MESSAGE, HANDLER and AFTER. Without optional arguments, this is just like process-send-string. If STRING is not a string, then it is assumed to be an elisp function and will be called when encountered in the send queue. The send will be the next one if WAIT, after the last send if AFTER, otherwise it will be put at the end of the queue. If WAIT is non-NIL or on the first send to a busy inferior, the inferior will be interrupted if possible, see comint-interrupt for more information. Once the send is sent, the process status will be STATUS or 'run. Output of the send will be inserted into the process buffer unless NO-INSERT. This function returns a list of (result . prompt). If WAIT is a string, output will be inserted until one matches the string as a regexp. If WAIT is T, then PROMPT will have the prompt when finished and RESULT will have the output. If PROMPT is a list, then there was an error. If WAIT is not T, then the list returned will change when the send has been sent and is finished. If HANDLER is nil it will be set to comint-handler. If it is T, errors will be ignored. When a send is finished, it calls handler with (error-p WAIT MESSAGE output prompt) which decides what to do with the output. VARIABLES: comint-always-scroll will cause all process output to be visible. comint-fix-error is the string used to fix errors. comint-continue is the string used to continue after an interrupt. comint-interrupt-regexp is the default regexp to use in finding the start of the interrupt text. comint-error-regexp will set comint-errorp if found in the process output. FUNCTIONS: Each of the functions in these variables is called with the buffer set to the appropriate process buffer and comint-original-buffer bound to the buffer current when the process filter was called. comint-update-status is a function (status) that is called each time the process status changes. comint-prompt-status is called with the old prompt and the last line. It should return 'error if the last line is an error, T if it is a prompt and nil otherwise. It should also update the process status by funcalling comint-update-status. comint-output-filter is a function (output) for sends with NO-INSERT. It should return the output string. comint-interrupt-start is a function (output) that returns the start of the interrupt text in output using comint-interrupt-regexp to find it."]) (fset 'comint-send-code #[(process code) " \nÉ&" [comint-send process code nil t] 9 "\ Execute after the previous send in PROCESS queue CODE. You do not want to execute synchronous sends in the code or it will lock up. "]) (fset 'comint-default-send #[(process string) " !q\n@@\n@AAAA \n=!@!ʠ@!̡ \"  Q +" [process-buffer process comint-end-queue top old string comint-send-queue comint-update-status run comint-send-variables t comint-send-results nil comint-sender comint-send-newline "\n"] 5 "\ Send to PROCESS top-level, STRING."]) (fset 'comint-sync #[(process start start-regexp end end-regexp) " \n & \n&" [comint-send process start nil start-regexp sync "Start sync" #[(error-p wait message output prompt) " \n\"p! @@\"Ƈ" [string-match wait output comint-sender get-buffer-process comint-send-queue nil] 3] end t end-regexp "End sync" (lambda (&rest args))] 8 "\ Synchronize with PROCESS output stream. START will be sent with each prompt received until START-REGEXP shows up in the stream. Then END will be sent and all output will be discarded until END-REGEXP shows up in the output stream."]) (fset 'comint-abort-sends #[(&optional process) "p!!q =? @!\n   \n@!A?\n@:C AAAAAР!A@̉B\nC !qed|) = @AAAA@q!cc)!@;̉̉B\n B  A )6!@̠@ B! A A u )!?!.)" [process get-buffer-process process-buffer t comint-aborting comint-send-queue comint-end-queue inhibit-quit send comint-send-variables vars pointer nil new comint-send-results interrupt (lambda (&rest args) t) "Interrupt" (lambda (&rest args) t) comint-interrupt-subjob get-buffer-create "*Aborted Commands*" comint-send-description "\n\n" comint-fix-error fix "Fixing error" 0 bury-buffer reverse run-hooks comint-abort-hook comint-dispatch-send] 12 "\ Abort all of the pending sends for optional PROCESS and show their messages in *Aborted Commands*." nil]) (fset 'comint-current-send #[(showp) " \n qc @AAAA@ Pc) Ai*\n@!P!" [showp comint-output-buffer comint-send-queue send "Pending commands:\n" message "\n" nil "Command: " comint-send-description "Unknown"] 5 "\ Show the message of the current send in the minibuffer." "P"]) (byte-code "!!Ň" [(lambda nil (if (listp popper-pop-buffers) (setq popper-pop-buffers (cons comint-error-buffer (cons comint-output-buffer popper-pop-buffers)))) (if (listp popper-buffers-to-skip) (setq popper-buffers-to-skip (cons comint-error-buffer (cons comint-output-buffer popper-buffers-to-skip))))) popper-load-hook boundp popper-pop-buffers run-hooks nil] 2) (fset 'comint-display-output #[(text &optional buffer) " q\nc!)\n" [buffer comint-output-buffer text set-buffer-modified-p nil] 4 "\ Put TEXT in optional BUFFER and show it in a small temporary window."]) (fset 'comint-display-error #[(text) " \n\"" [comint-display-output text comint-error-buffer] 3 "\ Put TEXT in the comint-error-buffer and display it."]) (provide 'comint-ipc)