4e987026 |
(provide (quote comint))
(defconst comint-version "2.01")
(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 input-ring-size 30 "\
Size of input history ring.")
(defvar comint-get-old-input (function 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 (function 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 (function (lambda (str) (not (string-match "\\`\\s *\\'" str)))) "\
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 (function 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, this is your hook. This is called from
the user command comint-send-input. comint-simple-send just sends
the string plus a newline.")
(defvar comint-eol-on-send (quote T) "\
If non-nil, then jump to the end of the line before sending input to process.
See COMINT-SEND-INPUT")
(defvar comint-mode-hook (quote nil) "\
Called upon entry into comint-mode")
(defvar comint-mode-map nil)
(defun comint-mode nil "\
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 mode 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 input-ring-size, and
can be accessed with the commands comint-next-input [\\[comint-next-input]] and
comint-previous-input [\\[comint-previous-input]]. Commands not keybound by
default are 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" (interactive) (byte-code "̈�� \"� �!� � �щ�҉�Ӊ��!���!�� ����!� ���!���!��!���!�ى
���!���!���!���!���!���!�
����!��!�{ � �!�*�" [old-ring input-ring old-ptyp comint-ptyp major-mode mode-name mode-line-process comint-mode-map comint-last-input-end comint-last-input-match input-ring-index input-ring-size nil assq buffer-local-variables boundp kill-all-local-variables comint-mode "Comint" (": %s") use-local-map make-local-variable make-marker "" comint-prompt-regexp 0 comint-get-old-input comint-input-sentinel comint-input-filter comint-input-sender comint-eol-on-send run-hooks comint-mode-hook ring-p make-ring] 23))
(if comint-mode-map nil (setq comint-mode-map (make-sparse-keymap)) (define-key comint-mode-map "p" (quote comint-previous-input)) (define-key comint-mode-map "n" (quote comint-next-input)) (define-key comint-mode-map "s" (quote comint-previous-similar-input)) (define-key comint-mode-map "
" (quote comint-send-input)) (define-key comint-mode-map "" (quote comint-delchar-or-maybe-eof)) (define-key comint-mode-map "" (quote comint-bol)) (define-key comint-mode-map "" (quote comint-kill-input)) (define-key comint-mode-map "" (quote backward-kill-word)) (define-key comint-mode-map "" (quote comint-interrupt-subjob)) (define-key comint-mode-map "" (quote comint-stop-subjob)) (define-key comint-mode-map "" (quote comint-quit-subjob)) (define-key comint-mode-map "" (quote comint-kill-output)) (define-key comint-mode-map "r" (quote comint-previous-input-matching)) (define-key comint-mode-map "" (quote comint-show-output)) (define-key comint-mode-map "P" (quote comint-msearch-input)) (define-key comint-mode-map "N" (quote comint-psearch-input)) (define-key comint-mode-map "R" (quote comint-msearch-input-matching)))
(defun full-copy-sparse-keymap (km) "\
Recursively copy the sparse keymap KM" (byte-code ":� �@!�A!B� �" [km t full-copy-sparse-keymap] 4))
(defun comint-check-proc (buffer-name) "\
True if there is a process associated w/buffer BUFFER-NAME, and
it is alive (status RUN or STOP)." (byte-code "� !�
�!�>)�" [proc buffer-name get-buffer-process process-status (run stop)] 4))
(defun make-comint (name program &optional startfile &rest switches) (byte-code "�� �Q!�!
?� �
!�>?�( �q�� )��
%�*�" [buffer name proc program startfile switches get-buffer-create "*" get-buffer-process process-status (run stop) comint-mode comint-exec] 10))
(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.")
(defun comint-exec (buffer name command startfile switches) "\
Fires up a process in 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." (byte-code "�q��! � � !)��
$��!���db��� !`\")��O ��!�db��!��`d\"���`d\"�� \"�)�" [buffer proc name command switches comint-ptyp process-connection-type startfile get-buffer-process delete-process comint-exec-1 make-local-variable set-marker process-mark sleep-for 1 insert-file-contents buffer-substring delete-region comint-send-string] 13))
(defun comint-exec-1 (name buffer command switches) (byte-code "�!� ���� \"��E\"��
%)�I ��!��!��!Վ����� \"\"����\"����\"���
%)+�" [process-environment name buffer command switches tcapv termv emv boundp comint-update-env format "TERMCAP=emacs:co#%d:tc=unknown" screen-width "TERM=emacs" "EMACS=t" apply start-process getenv "TERMCAP" "TERM" "EMACS" ((byte-code "��\"��� \"���
\"�" [tcapv termv emv setenv "TERMCAP" "TERM" "EMACS"] 5)) setenv "emacs:co#%d:tc=unknown" "emacs" "t"] 19))
(defun comint-update-env (old-env new) (byte-code "� !�� \"�C @��\"� ���!OA��
�+ �
\"?�> |