;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Module: VMS-PROCESS.EL ;; Author: A. Grant ;; Creation Date: 19-Oct-1990 ;; Version: 1.00 ;; ;; ;; A fudge of enough of the Unix style sub-process stuff to get SmallTalk ;; working. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defvar smalltalk-process-exists nil) (defvar smalltalk-filter nil) (defun get-buffer-process (bufid) "Return the process id (and create it if necessary)." ;; (insert "Entering get-buffer-process") ;; (insert ?\n) (if (not smalltalk-process-exists) (progn (setq shell-mode-map nil) (setq smalltalk-buffer bufid) (setq smalltalk-process-mark (point-marker)) (setq smalltalk-process-exists (spawn-subprocess 13 'smalltalk-input 'smalltalk-exit)) (and smalltalk-process-exists (send-command-to-subprocess 13 "SET NOON")) (send-command-to-subprocess 13 "mst -q -p ""-V"" ") (send-command-to-subprocess 13 "FileStream fileIn: 'smalltalk_kernel:emacs_mode.st' !"))) 13) (defun smalltalk-input (name str) "Handles input from the smalltalk process. Called by Emacs." (cond (smalltalk-filter (progn (eval (list smalltalk-filter 13 str)))) (t (progn (insert str) (insert ?\n)))) (setq smalltalk-process-mark (point-marker))) (defun smalltalk-exit (name) "Called by Emacs when smalltalk dies." (setq smalltalk-process-exists nil) (message "SmallTalk Process dieded.")) (defun process-buffer (procid) "Return the buffer PROCID is associated with. Note that in this fudge, PROCID should be 13." ;; (insert "Entering process-buffer") ;; (insert ?\n) (cond ((not (eq procid 13)) (progn (insert "AlTalk: process-buffer: received invalid PROCID") (insert ?\n) nil)) (t smalltalk-buffer))) (defun process-send-string (name str) "Send PROC the contents of STR as input. PROC should be 13." ;; (insert ?\n) ;; (insert "Entering process-send-string: ") ;; (insert str) ;; (insert "|") ;; (insert ?\n) (send-command-to-subprocess 13 str)) (defun process-status (procid) "Return the status of the process. This is a simplistic version :- run -- process is running. nil -- everything else." ;; (insert "Entering process-status: ") ;; (insert ?\n) (cond (smalltalk-process-exists 'run) (t nil))) (setq status (process-status 14)) (defun process-mark (procid) "Return the marker for the end of the last output from PROCID." ;; (insert "Entering process-mark") ;; (insert ?\n) smalltalk-process-mark) (defun set-process-filter (procid filter-name) "Set the process filter." ;; (insert "Entering set-process-filter") ;; (insert ?\n) (setq smalltalk-filter filter-name))