;ELC ;;; compiled by roland@churchy.gnu.ai.mit.edu on Tue Aug 10 13:35:53 1993 ;;; from file /gd/gnu/emacs/19.0/lisp/comint.el ;;; emacs version 19.18.0. ;;; bytecomp version FSF 2.10 ;;; 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 "!" ["2.03" comint-version require ring] 2) (defvar comint-prompt-regexp "^" "\ Regexp to recognise prompts in the inferior process. Defaults to \"^\", the null string at BOL. Good choices: Canonical Lisp: \"^[^> ]*>+:? *\" (Lucid, franz, kcl, T, cscheme, oaklisp) Lucid Common Lisp: \"^\\\\(>\\\\|\\\\(->\\\\)+\\\\) *\" franz: \"^\\\\(->\\\\|<[0-9]*>:\\\\) *\" kcl: \"^>+ *\" shell: \"^[^#$%>]*[#$%>] *\" T: \"^>+ *\" This is a good thing to set in mode hooks.") (defvar comint-input-ring-size 30 "\ Size of input history ring.") (defvar comint-process-echoes nil "\ *If non-nil, assume that the subprocess echoes any input. If so, delete one copy of the input so that only one copy eventually appears in the buffer. This variable is buffer-local.") (defvar comint-get-old-input (quote comint-get-old-input-default) "\ Function that submits old text in comint mode. This function is called when return is typed while the point is in old text. It returns the text to be submitted as process input. The default is `comint-get-old-input-default', which grabs the current line, and strips off leading text matching `comint-prompt-regexp'.") (defvar comint-input-sentinel (quote ignore) "\ Called on each input submitted to comint mode process by `comint-send-input'. Thus it can, for instance, track cd/pushd/popd commands issued to the csh.") (defvar comint-input-filter #[(str) "\n\"?" [string-match "\\`\\s *\\'" str] 3] "\ Predicate for filtering additions to input history. Only inputs answering true to this function are saved on the input history list. Default is to save anything that isn't all whitespace") (defvar comint-input-sender (quote comint-simple-send) "\ Function to actually send to PROCESS the STRING submitted by user. Usually this is just `comint-simple-send', but if your mode needs to massage the input string, put a different function here. `comint-simple-send' just sends the string plus a newline. This is called from the user command `comint-send-input'.") (defvar comint-eol-on-send t "\ *Non-nil means go to the end of the line before sending input to process. See `comint-send-input'.") (defvar comint-mode-hook nil "\ Called upon entry into comint-mode This is run before the process is cranked up.") (defvar comint-exec-hook nil "\ Called each time a process is exec'd by `comint-exec'. This is called after the process is cranked up. It is useful for things that must be done each time a process is executed in a comint mode buffer (e.g., `(process-kill-without-query)'). In contrast, the `comint-mode-hook' is only executed once when the buffer is created.") (byte-code "!‡" [boundp comint-mode-map nil] 2) (defvar comint-ptyp t "\ True if communications via pty; false if by pipe. Buffer local. This is to work around a bug in Emacs process signalling.") (byte-code "!##" [boundp comint-input-ring nil put permanent-local t comint-ptyp] 4) (defalias 'comint-mode #[nil " !! \n!  !!!!!!!!!!!!!b!" [kill-all-local-variables comint-mode major-mode "Comint" mode-name (": %s") mode-line-process use-local-map comint-mode-map make-local-variable comint-last-input-start make-marker comint-last-input-end comint-prompt-regexp comint-input-ring-size comint-input-ring comint-input-ring-index 0 comint-get-old-input comint-input-sentinel comint-input-filter comint-input-sender comint-eol-on-send comint-ptyp comint-exec-hook comint-process-echoes run-hooks comint-mode-hook make-ring] 2 "\ Major mode for interacting with an inferior interpreter. Interpreter name is same as buffer name, sans the asterisks. Return at end of buffer sends line as input. Return not at end copies rest of line to end and sends it. Setting variable `comint-eol-on-send' means jump to the end of the line before submitting new input. This mode is typically customised to create Inferior Lisp mode, Shell mode, etc. This can be done by setting the hooks `comint-input-sentinel', `comint-input-filter', `comint-input-sender' and `comint-get-old-input' to appropriate functions, and the variable `comint-prompt-regexp' to the appropriate regular expression. An input history is maintained of size `comint-input-ring-size', and can be accessed with the commands \\[comint-next-input] and \\[comint-previous-input]. Commands with no default key bindings include `send-invisible', `comint-dynamic-complete', and `comint-list-dynamic-completions'. If you accidentally suspend your process, use \\[comint-continue-subjob] to continue it. \\{comint-mode-map} Entry to this mode runs the hooks on comint-mode-hook" nil]) (byte-code "m #################" [comint-mode-map make-sparse-keymap define-key "p" comint-previous-input "n" comint-next-input "r" comint-previous-matching-input "s" comint-next-matching-input " " comint-send-input "" comint-delchar-or-maybe-eof "" comint-bol "" comint-kill-input "" backward-kill-word "" comint-interrupt-subjob "" comint-stop-subjob "" comint-quit-subjob "" comint-kill-output "" comint-show-output "" comint-next-prompt "" comint-prev-prompt "" comint-send-eof] 4) (defalias 'full-copy-sparse-keymap #[(km) ":@!A!B" [km full-copy-sparse-keymap] 3 "\ Recursively copy the sparse keymap KM."]) (defalias 'comint-check-proc #[(buffer) " ! \n!>)" [get-buffer-process buffer proc process-status (run stop)] 3 "\ True if there is a living process associated w/buffer BUFFER. Living means the status is `run' or `stop'. BUFFER can be either a buffer or the name of one."]) (defalias 'make-comint #[(name program &optional startfile &rest switches) "\nQ! ! q ) \n % )" [get-buffer-create "*" name buffer comint-check-proc comint-mode comint-exec program startfile switches] 6 "\ Make a comint process NAME in a buffer, running PROGRAM. The name of the buffer is made by surrounding NAME with `*'s. If there is already a running process in that buffer, it is not restarted. Optional third arg STARTFILE is the name of a file to send the contents of to the process. Any more args are arguments to PROGRAM."]) (defalias 'comint-exec #[(buffer name command startfile switches) "q!\n!) $\n\"!  db\n!`ΓQ!db!`d{`d|\n\"!*" [buffer get-buffer-process proc delete-process comint-exec-1 name command switches set-process-filter comint-filter make-local-variable comint-ptyp process-connection-type process-mark nil startfile sleep-for 1 insert-file-contents comint-send-string run-hooks comint-exec-hook] 6 "\ Start up a process in buffer BUFFER for comint modes. Blasts any old process running in the buffer. Doesn't set the buffer mode. You can use this to cheaply run a series of processes in the same comint buffer. The hook `comint-exec-hook' is run after each exec."]) (byte-code "\"\"" [defalias comint-exec-1 #[(name buffer command switches) " \"E\" \n  %)" [comint-update-env process-environment format "TERMCAP=emacs:co#%d:tc=unknown" frame-width "TERM=emacs" "EMACS=t" apply start-process name buffer command switches] 6] comint-update-env #[(old-env new) " ! \"H@\"!ʉO A 4 D ? B  B* *" [reverse new mapcar #[(vv) "\n\" \nÉO" [string-match "^[^=]*=" vv 0] 3] vars ans old-env vv string-match "^[^=]*=" 0 var] 4]] 3) (defalias 'comint-previous-input #[(arg) " !X! ] !! ]`p!!| G V9͂E WD΂E   \\\n  T\"  \"c)" [ring-length comint-input-ring len 0 message "Empty input ring" ding comint-after-pmark-p "Not after process mark" process-mark get-buffer-process comint-input-ring-index arg -1 1 "%d" ring-ref] 5 "\ Cycle backwards through input history." "*p"]) (defalias 'comint-next-input #[(arg) " [!" [comint-previous-input arg] 2 "\ Cycle forwards through input history." "*p"]) (defalias 'comint-previous-matching-input #[(regexp arg) " ! Vǂ Uj \n \\   WW  \"\"W \\  \nU-!-) Vc Se T Z!+" [comint-input-ring-index -1 ring-length comint-input-ring len arg 0 1 motion n prev string-match regexp ring-ref error "Not found" comint-previous-input] 6 "\ Search backwards through input history for match for REGEXP. (Previous history elements are earlier commands.) With prefix argument N, search for Nth previous match. If N is negative, find the next or Nth next match." (byte-code "\n %ȘA@\n!+D" [nil minibuffer-history-sexp-flag last-command read-from-minibuffer "Previous input matching (regexp): " minibuffer-local-map minibuffer-history-search-history regexp "" prefix-numeric-value current-prefix-arg] 7)]) (defalias 'comint-next-matching-input #[(regexp arg) " \n[\"" [comint-previous-matching-input regexp arg] 3 "\ Search forwards through input history for match for REGEXP. (Later history elements are more recent commands.) With prefix argument N, search for Nth following match. If N is negative, find the previous or Nth previous match." (byte-code " %Ș A@\n!+D" [nil last-command read-from-minibuffer "Previous input matching (regexp): " minibuffer-local-map minibuffer-history-search-history regexp minibuffer-history-sexp-flag "" prefix-numeric-value current-prefix-arg] 8)]) (defalias 'comint-send-input #[nil "p!!~ ! !`Y,& `{;\n  b c )  I `|Lc ![ \" !  \" ɓ`ɓ !`ɓ+)" [get-buffer-process proc error "Current buffer has no process" process-mark pmark marker-position pmark-val comint-eol-on-send nil comint-get-old-input copy input comint-process-echoes 10 comint-input-filter ring-insert comint-input-ring comint-input-sentinel comint-input-sender comint-input-ring-index comint-last-input-start comint-last-input-end] 4 "\ Send input to process. After the process output mark, sends all text from the process mark to point as input to the process. Before the process output mark, calls value of variable `comint-get-old-input' to retrieve old input, copies it to the process mark, and sends it. If variable `comint-process-echoes' is nil, a terminal newline is also inserted into the buffer and sent to the process (if it is non-nil, all text from the process mark to point is deleted, since it is assumed the remote process will re-echo it). The value of variable `comint-input-sentinel' is called on the input before sending it. The input is entered into the input history ring, if the value of variable `comint-input-filter' returns non-nil when called on the input. If variable `comint-eol-on-send' is non-nil, then point is moved to the end of line before sending the input. `comint-get-old-input', `comint-input-sentinel', and `comint-input-filter' are chosen according to the command interpreter running in the buffer. E.g., If the interpreter is the csh, comint-get-old-input is the default: take the current line, discard any initial string matching regexp comint-prompt-regexp. comint-input-sentinel monitors input for \"cd\", \"pushd\", and \"popd\" commands. When it sees one, it cd's the buffer. comint-input-filter is the default: returns T if the input isn't all white space. If the comint is Lucid Common Lisp, comint-get-old-input snarfs the sexp ending at point. comint-input-sentinel does nothing. comint-input-filter returns NIL if the input matches input-filter-regexp, which matches (1) all whitespace (2) :a, :c, etc. Similarly for Soar, Scheme, etc." nil]) (defalias (quote comint-filter) #[(process string) "p!q`edG ~!b` X/ \\`\nW:\n\\` XE \\! !`U] `GZ\"y!y`UyZ!` *\n } b q," [nil oend obeg opoint obuf process-buffer process string nchars buffer-read-only process-mark insert-before-markers window-start selected-window set-window-start comint-last-input-end marker-buffer force-mode-line-update] 4]) (defalias 'comint-get-old-input-default #[nil "y `\n`{*" [0 comint-skip-prompt beg nil] 2 "\ Default for `comint-get-old-input'. Take the current line, and discard any initial text matching `comint-prompt-regexp'."]) (defalias 'comint-skip-prompt #[nil "`) !ĕ Xĕb)" [nil eol looking-at comint-prompt-regexp 0] 2 "\ Skip past the text matching regexp `comint-prompt-regexp'. If this takes us past the end of the current line, don't skip at all."]) (defalias 'comint-after-pmark-p #[nil "p!!!`X)" [marker-position process-mark get-buffer-process proc-pos] 5 "\ Is point after the process output marker?"]) (defalias 'comint-simple-send #[(proc string) " \n\" \"" [comint-send-string proc string "\n"] 3 "\ Default function for sending to PROC input STRING. This just sends STRING plus a newline. To override this, set the hook `comint-input-sender'."]) (defalias 'comint-bol #[(arg) "y ?\n " [0 arg comint-skip-prompt] 1 "\ Goes to the beginning of line, then skips past the prompt, if any. If a prefix argument is given (\\[universal-argument]), then no prompt skip -- go straight to column 0. The prompt skip is done by skipping text matching the regular expression `comint-prompt-regexp', a buffer local variable. If you don't like this command, bind C-a to `beginning-of-line' in your hook, `comint-mode-hook'." "P"]) (defalias 'comint-read-noecho #[(prompt &optional stars) "  % G\"#* ! U=‰URURUX‰Ue UU!P GV O É!!!-" ["" 0 t nil done cursor-in-echo-area echo-keystrokes c ans stars message "%s%s" prompt make-string 42 read-char 7 quit-flag 13 10 27 21 8 127 char-to-string -1 "Quit" beep] 7 "\ Read a single line of text from user without echoing, and return it. Prompt with argument PROMPT, a string. Optional argument STARS causes input to be echoed with '*' characters on the prompt line. Input ends with RET, LFD, or ESC. DEL or C-h rubs out. C-u kills line. C-g aborts (if `inhibit-quit' is set because e.g. this function was called from a process filter and C-g is pressed, this function returns nil rather than a string). Note that the keystrokes comprising the text can still be recovered (temporarily) with \\[view-lossage]. This may be a security bug for some applications."]) (defalias 'send-invisible #[(str) "p!!# ; \"\" \")" [get-buffer-process proc error "Current buffer has no process" comint-send-string str comint-read-noecho "Non-echoed text: " t "\n"] 6 "\ Read a string without echoing. Then send it to the process running in the current buffer. A new-line is additionally sent. String is not saved on comint input history list. Security bug: your string can still be temporarily recovered with \\[view-lossage]." "P"]) (defvar comint-input-chunk-size 512 "\ *Long inputs are sent to comint processes in chunks of this size. If your process is choking on big inputs, try lowering the value.") (defalias 'comint-send-string #[(proc str) "G\n^  O\" W/ \n\\  ^O\")*" [str len comint-input-chunk-size i process-send-string proc 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."]) (defalias 'comint-send-region #[(proc start end) " \n {\"" [comint-send-string proc start end] 4 "\ Sends to PROC the region delimited by START and END. This is a replacement for `process-send-region' that tries to keep your process from hanging on long inputs. See `comint-send-string'."]) (defalias 'comint-kill-output #[nil "p!! \n\"\nbc\n`Ɠ)" [process-mark get-buffer-process pmark kill-region comint-last-input-end "*** output flushed ***\n" nil] 3 "\ Kill all output from interpreter since last input." nil]) (defalias 'comint-show-output #[nil "b y `\"" [comint-last-input-end backward-char 0 set-window-start selected-window nil] 3 "\ Display start of this batch of interpreter output at top of window. Also put cursor there." nil]) (defalias 'comint-interrupt-subjob #[nil "\n\"" [interrupt-process nil comint-ptyp] 3 "\ Interrupt the current subjob." nil]) (defalias 'comint-kill-subjob #[nil "\n\"" [kill-process nil comint-ptyp] 3 "\ Send kill signal to the current subjob." nil]) (defalias 'comint-quit-subjob #[nil "\n\"" [quit-process nil comint-ptyp] 3 "\ Send quit signal to the current subjob." nil]) (defalias 'comint-stop-subjob #[nil "\n\"" [stop-process nil comint-ptyp] 3 "\ Stop the current subjob. WARNING: if there is no current subjob, you can end up suspending the top-level process running in the buffer. If you accidentally do this, use \\[comint-continue-subjob] to resume the process. (This is not a problem with most shells, since they ignore this signal.)" nil]) (defalias 'comint-continue-subjob #[nil "\n\"" [continue-process nil comint-ptyp] 3 "\ Send CONT signal to process buffer's process group. Useful if you accidentally suspend the top-level process." nil]) (defalias 'comint-kill-input #[nil "p!!\n!` V\n`\"*" [process-mark get-buffer-process pmark marker-position p-pos kill-region] 3 "\ Kill all text from last stuff output by interpreter to point." nil]) (defalias 'comint-delchar-or-maybe-eof #[(arg) "m \n!" [process-send-eof delete-char arg] 2 "\ Delete ARG characters forward, or send an EOF to process if at end of buffer." "p"]) (defalias 'comint-send-eof #[nil " " [process-send-eof] 1 "\ Send an EOF to the current buffer's process." nil]) (defalias 'comint-next-prompt #[(n) " ‰ $" [re-search-forward comint-prompt-regexp nil n] 5 "\ Move to end of next prompt in the buffer (with prefix arg, Nth next). See `comint-prompt-regexp'." "p"]) (defalias 'comint-prev-prompt #[(n) " #ĕ)`U T ‰ $ĕb" [re-search-backward comint-prompt-regexp nil t 0 n] 5 "\ Move to end of previous prompt in the buffer (with prefix arg, Nth previous). See `comint-prompt-regexp'." "p"]) (byte-code "\"\"" [defalias comint-source-default #[(previous-dir/file source-modes) " \n>!!B B" [buffer-file-name major-mode source-modes file-name-directory file-name-nondirectory previous-dir/file default-directory nil] 3] comint-check-source #[(fname) " !&\n!&\n!\"!&p\nq q))" [get-file-buffer fname buff buffer-modified-p y-or-n-p format "Save buffer %s first? " buffer-name old-buffer save-buffer] 6]] 3) (defalias 'comint-extract-string #[nil "`y``b\n#`Tb #)`S\n:\n:\n{." [point 0 bol nil eol search-backward "\"" t start search-forward end] 4 "\ Return string around POINT that starts the current line, or nil."]) (byte-code "\"\"" [defalias comint-get-source #[(prompt prev-dir/file source-modes mustmatch-p) " \n\" ȏ !?\n# !% @ \n2 !4 AF#H P$!!.C" [comint-source-default prev-dir/file source-modes def comint-extract-string stringfile nil (file-exists-p stringfile) ((error)) file-directory-p sfile-p file-name-directory defdir file-name-nondirectory deffile read-file-name format "%s(default %s) " prompt mustmatch-p ans expand-file-name substitute-in-file-name] 6] comint-proc-query #[(proc str) " ! !\n!\nq\n! !  \" ! \"?T ! \"! \"M!S \")," [process-buffer proc proc-buf process-mark proc-mark display-buffer get-buffer-window marker-position proc-pt proc-win comint-send-string str accept-process-output pos-visible-in-window-p window-point opoint set-window-point sit-for 0 push-mark] 3]] 3) (defalias 'comint-match-partial-pathname #[nil "# u!!!̔̕{!)" [re-search-backward "[^~/A-Za-z0-9_.$#,=-]" nil move 1 looking-at "[~/A-Za-z0-9_.$#,=-]" error "" re-search-forward "[~/A-Za-z0-9_.$#,=-]+" substitute-in-file-name 0] 4 "\ Return the filename at point, or signal an error."]) (defalias 'comint-replace-by-expanded-filename #[nil "  ! ! \"$ \" >=1!>ΔΕ| P!c," [comint-match-partial-pathname pathname file-name-directory pathdir file-name-nondirectory pathnondir file-name-completion default-directory completion message "No completions of %s" ding t "Sole completion" 0 expand-file-name] 4 "\ Expand the filename at point. Replace the filename with an expanded, canonicalised, and completed replacement. \"Expanded\" means environment variables (e.g., $HOME) and ~'s are replaced with the corresponding directories. \"Canonicalised\" means .. and . are removed, and the filename is made absolute instead of relative. See functions `expand-file-name' and `substitute-in-file-name'. See also `comint-dynamic-complete'." nil]) (defalias 'comint-dynamic-complete #[nil "t  =  ! !)!+ \" < \" U =I!Uҕb GOc," [last-command this-command comint-dynamic-list-completions comint-match-partial-pathname pathname file-name-directory pathdir file-name-nondirectory pathnondir file-name-completion expand-file-name default-directory completion message "No completions of %s" ding t "Sole completion" 0 nil] 5 "\ Dynamically complete the filename at point. This function is similar to `comint-replace-by-expanded-filename', except that it won't change parts of the filename already entered in the buffer; it just adds completion characters to the end of the filename." nil]) (defalias 'comint-dynamic-list-completions #[nil "  ! !  !\" * \" V ϐ !!! =O!UC*," [comint-match-partial-pathname pathname file-name-directory pathdir file-name-nondirectory pathnondir file-name-all-completions expand-file-name default-directory completions message "No completions of %s" ding current-window-configuration conf "*Help*" display-completion-list sit-for 0 "Hit space to flush" read-event ch 32 set-window-configuration unread-command-events] 5 "\ List in help buffer all possible completions of the filename at point." nil]) (defvar comint-load-hook nil "\ This hook is run when comint is loaded in. This is a good place to put keybindings.") (byte-code "!!" [run-hooks comint-load-hook provide comint] 2)