• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/progmodes/

Lines Matching +defs:signal +defs:process

40 (defvar xscheme-previous-process-state)
43 (defvar xscheme-process-command-line nil
44 "Command used to start the most recent Scheme process.")
46 (defvar xscheme-process-name "scheme"
47 "Name of xscheme process that we're currently interacting with.")
56 "List of expressions recently transmitted to the Scheme process.")
62 "This variable, if nil, indicates that the scheme process is
68 signaled until the scheme process acknowledges receipt.")
72 by the scheme process, so additional control-g's are to be ignored.")
75 "Procedure to send the string argument from the scheme process.")
84 (defvar xscheme-process-filter-state 'idle
85 "State of scheme process escape reader state machine:
91 "This variable, if nil, prevents output from the scheme process
92 from being inserted into the process-buffer.")
98 "Accumulator for the string being received from the scheme process.")
101 (setq-default scheme-mode-line-process
107 xscheme-process-filter-state
114 scheme-mode-line-process))
134 has finished evaluating will signal an error."
139 "This is the Scheme process buffer.
145 "String to insert into Scheme process buffer first time it is started.
150 (defcustom xscheme-signal-death-message nil
151 "If non-nil, causes a message to be generated when the Scheme process dies."
156 "If non-nil, a procedure to call when the Scheme process is started.
157 When called, the current buffer will be the Scheme process-buffer."
171 (define-key keymap "\C-c\C-s" 'xscheme-select-process-buffer)
182 "Run MIT Scheme in an inferior process.
186 (xscheme-start command-line xscheme-process-name xscheme-buffer-name))
188 (defun xscheme-start (command-line process-name buffer-name)
189 (setq-default xscheme-process-command-line command-line)
191 (xscheme-start-process command-line process-name buffer-name))
192 (make-local-variable 'xscheme-process-command-line)
193 (setq xscheme-process-command-line command-line))
197 (or xscheme-process-command-line
213 "Reset the Scheme process."
215 (let ((process (get-process xscheme-process-name)))
216 (cond ((or (not process)
217 (not (eq (process-status process) 'run))
219 "The Scheme process is running, are you SURE you want to reset it? "))
220 (message "Resetting Scheme process...")
221 (if process
223 (kill-process process t)
224 (delete-process process)))
225 (xscheme-start-process xscheme-process-command-line
226 xscheme-process-name
228 (message "Resetting Scheme process...done")))))
242 (let ((process (get-buffer-process buffer)))
243 (if process
267 (let ((process-name (verify-xscheme-buffer buffer-name nil)))
269 (setq-default xscheme-process-name process-name)
274 (if (eq (process-status process-name) 'run)
284 (let ((process-name (verify-xscheme-buffer buffer-name t)))
287 (make-local-variable 'xscheme-process-name)
288 (setq xscheme-process-name process-name)
296 (if (xscheme-process-buffer-current-p)
299 (kill-local-variable 'xscheme-process-name)
303 (if (and localp (xscheme-process-buffer-current-p))
306 (process (and buffer (get-buffer-process buffer))))
309 ((not process)
314 (if (not (xscheme-process-buffer-current-p))
317 (process-name process)))))
323 "Major mode for interacting with an inferior MIT Scheme process.
326 \\[advertised-xscheme-send-previous-expression] sends the expression before point to the Scheme process as input
330 All output from the Scheme process is written in the Scheme process
332 evaluating a Scheme expression is also printed in the process buffer,
333 preceded by the string \";Value: \" to highlight it. If the process
335 in the minibuffer. If an error occurs, the process buffer will
338 While the Scheme process is running, the modelines of all buffers in
339 scheme-mode are modified to show the state of the process. The
346 The process buffer's modeline contains additional information where
376 interpreters will change the major mode of the Scheme process buffer
379 themselves to the Scheme process. The command character ? will list
401 (make-local-variable 'xscheme-process-name)
402 (make-local-variable 'xscheme-previous-process-state)
410 (let ((process (get-buffer-process buffer)))
411 (if process
413 (setq xscheme-process-name (process-name process))
414 (setq xscheme-previous-process-state
415 (cons (process-filter process)
416 (process-sentinel process)))
417 (xscheme-process-filter-initialize t)
419 (set-process-sentinel process 'xscheme-process-sentinel)
420 (set-process-filter process 'xscheme-process-filter))
421 (setq xscheme-previous-process-state (cons nil nil)))))))
431 (let ((previous-state xscheme-previous-process-state))
433 (let ((process (get-buffer-process (current-buffer))))
434 (if process
436 (if (eq (process-filter process) 'xscheme-process-filter)
437 (set-process-filter process (car previous-state)))
438 (if (eq (process-sentinel process) 'xscheme-process-sentinel)
439 (set-process-sentinel process (cdr previous-state))))))))
478 (set-buffer (xscheme-process-buffer))
494 sent to the Scheme process instead. Typing ? will show you which
523 "Transmit this character to the Scheme process."
529 (set-buffer (xscheme-process-buffer))
537 (let ((buffer (xscheme-process-buffer)))
547 "Send the string arguments to the Scheme process.
549 (cond ((not (xscheme-process-running-p))
550 (if (yes-or-no-p "The Scheme process has died. Reset it? ")
553 (xscheme-wait-for-process)
568 (let ((process (get-process xscheme-process-name)))
569 (process-send-string process (concat string "\n"))
570 (if (xscheme-process-buffer-current-p)
571 (set-marker (process-mark process) (point)))))
573 (defun xscheme-select-process-buffer ()
574 "Select the Scheme process buffer and move to its output point."
576 (let ((process
577 (or (get-process xscheme-process-name)
578 (error "No scheme process"))))
579 (let ((buffer (or (process-buffer process) (error "No process buffer"))))
584 (goto-char (process-mark process))))))
674 "Send the current region to the Scheme process.
677 (if (xscheme-process-buffer-current-p)
682 (set-marker (process-mark (get-process xscheme-process-name))
688 "Send the current definition to the Scheme process.
702 "Send the expression to the right of `point' to the Scheme process."
708 "Send the expression to the left of `point' to the Scheme process."
715 "Send the current line to the Scheme process.
729 "Send the current buffer to the Scheme process."
731 (if (xscheme-process-buffer-current-p)
736 "Prompt for a character and send it to the Scheme process."
738 (process-send-string xscheme-process-name (char-to-string char)))
743 (let ((proc (get-buffer-process (current-buffer))))
745 (goto-char (process-mark proc))
760 "Cause the Scheme process to enter a breakpoint."
765 "Cause the Scheme process to proceed from a breakpoint."
767 (process-send-string xscheme-process-name "(proceed)\n"))
778 (interrupt-process xscheme-process-name))
788 (interrupt-process xscheme-process-name)
793 "Cause the Scheme process to halt, returning to previous rep loop."
798 "Cause the Scheme process to halt, returning to current rep loop."
808 "Send a ^A type interrupt to the Scheme process."
810 (quit-process xscheme-process-name)
819 (defun xscheme-start-process (command-line the-process the-buffer)
821 (let ((process (get-buffer-process buffer)))
824 (if (and process (memq (process-status process) '(run stop)))
825 (set-marker (process-mark process) (point-max))
826 (progn (if process (delete-process process))
829 (setq xscheme-process-name the-process)
833 (setq process
834 (let ((process-connection-type nil))
835 (apply 'start-process
836 (cons the-process
840 (if (not (equal (process-name process) the-process))
841 (setq xscheme-process-name (process-name process)))
844 (message "Starting process %s in buffer %s"
845 xscheme-process-name
847 (set-marker (process-mark process) (point-max))
848 (xscheme-process-filter-initialize t)
850 (set-process-sentinel process 'xscheme-process-sentinel)
851 (set-process-filter process 'xscheme-process-filter)
877 (defun xscheme-wait-for-process ()
882 (defun xscheme-process-running-p ()
883 "True iff there is a Scheme process whose status is `run'."
884 (let ((process (get-process xscheme-process-name)))
885 (and process
886 (eq (process-status process) 'run))))
888 (defun xscheme-process-buffer ()
889 (let ((process (get-process xscheme-process-name)))
890 (and process (process-buffer process))))
892 (defun xscheme-process-buffer-window ()
893 (let ((buffer (xscheme-process-buffer)))
896 (defun xscheme-process-buffer-current-p ()
897 "True iff the current buffer is the Scheme process buffer."
898 (eq (xscheme-process-buffer) (current-buffer)))
903 (defvar xscheme-process-filter-alist
905 xscheme-process-filter:string-action-noexcursion)
907 xscheme-process-filter:string-action)
909 xscheme-process-filter:string-action)
911 xscheme-process-filter:string-action)
913 xscheme-process-filter:simple-action)
915 xscheme-process-filter:simple-action)
917 xscheme-process-filter:simple-action)
919 xscheme-process-filter:simple-action)
921 xscheme-process-filter:simple-action)
923 xscheme-process-filter:simple-action)
925 xscheme-process-filter:string-action)
927 xscheme-process-filter:string-action)
929 xscheme-process-filter:string-action)
931 xscheme-process-filter:simple-action)
933 xscheme-process-filter:string-action)
935 xscheme-process-filter:simple-action)
937 xscheme-process-filter:string-action)
939 xscheme-process-filter:string-action)
940 (?z xscheme-display-process-buffer
941 xscheme-process-filter:simple-action))
942 "Table used to decide how to handle process filter commands.
945 The first item is the character that the process filter dispatches on.
949 When the process filter sees a command whose character matches a
951 and the string containing the rest of the process filter's input
953 with the appropriate arguments, and to reenter the process filter with
959 (defun xscheme-process-sentinel (proc reason)
960 (let* ((buffer (process-buffer proc))
964 (xscheme-process-filter-initialize (eq reason 'run))
967 (setq scheme-mode-line-process "")
968 (setq xscheme-mode-string "no process")
972 xscheme-signal-death-message)
976 "The Scheme process has died! Do M-x reset-scheme to restart it"))))))
978 (defun xscheme-process-filter-initialize (running-p)
979 (setq xscheme-process-filter-state 'idle)
986 (setq scheme-mode-line-process '(": " xscheme-runlight-string))
994 (if running-p "?" "no process")))
996 (defun xscheme-process-filter (proc string)
1002 (set-buffer (process-buffer proc))
1003 (cond ((eq xscheme-process-filter-state 'idle)
1007 (xscheme-process-filter-output
1011 (setq xscheme-process-filter-state 'reading-type))
1014 (xscheme-process-filter-output string)))))
1015 ((eq xscheme-process-filter-state 'reading-type)
1021 (let ((entry (assoc char xscheme-process-filter-alist)))
1025 (xscheme-process-filter-output ?\e char)
1026 (setq xscheme-process-filter-state 'idle)))))))
1027 ((eq xscheme-process-filter-state 'reading-string)
1035 (setq xscheme-process-filter-state 'idle)
1048 (error "Scheme process filter -- bad state"))))
1055 (defun xscheme-process-filter-output (&rest args)
1094 (let ((process (get-process xscheme-process-name)))
1095 (set-buffer (process-buffer process))
1096 (goto-char (process-mark process))))
1116 (defun xscheme-process-filter:simple-action (action)
1117 (setq xscheme-process-filter-state 'idle)
1120 (defun xscheme-process-filter:string-action (action)
1123 (setq xscheme-process-filter-state 'reading-string))
1125 (defun xscheme-process-filter:string-action-noexcursion (action)
1126 (xscheme-process-filter:string-action (cons action nil)))
1129 "The character displayed when the Scheme process is running.")
1132 "The character displayed when the Scheme process is waiting for input.")
1135 "The character displayed when the Scheme process is garbage collecting.")
1158 (defun xscheme-display-process-buffer ()
1159 (let ((window (or (xscheme-process-buffer-window)
1160 (display-buffer (xscheme-process-buffer)))))
1184 (let* ((process (get-process xscheme-process-name))
1185 (window (get-buffer-window (process-buffer process))))
1187 (not (pos-visible-in-window-p (process-mark process)
1191 (xscheme-process-filter-output output-string))
1209 (xscheme-process-filter-output (substring string end))
1215 (set-buffer (xscheme-process-buffer))