comparison lisp/comint.el @ 182:35ea4993d08c

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Sat, 02 Feb 1991 12:41:08 +0000
parents 899728e6052a
children 4cd7543be581
comparison
equal deleted inserted replaced
181:a587d037d637 182:35ea4993d08c
145 145
146 \\{comint-mode-map} 146 \\{comint-mode-map}
147 147
148 Entry to this mode runs the hooks on comint-mode-hook." 148 Entry to this mode runs the hooks on comint-mode-hook."
149 (interactive) 149 (interactive)
150 (make-local-variable 'input-ring)
151 (put 'input-ring 'preserved t)
152 (kill-all-local-variables) 150 (kill-all-local-variables)
153 (setq major-mode 'comint-mode 151 (setq major-mode 'comint-mode
154 mode-name "Comint" 152 mode-name "Comint"
155 mode-line-process '(": %s")) 153 mode-line-process '(": %s"))
156 (use-local-map comint-mode-map) 154 (use-local-map comint-mode-map)
155 (set (make-local-variable 'input-ring) (make-ring input-ring-size))
156 (put 'input-ring 'preserved t)
157 (set (make-local-variable 'comint-last-input-match) "") 157 (set (make-local-variable 'comint-last-input-match) "")
158 (set (make-local-variable 'comint-last-similar--string) "") 158 (set (make-local-variable 'comint-last-similar--string) "")
159 (set (make-local-variable 'input-ring-index) 0) 159 (set (make-local-variable 'input-ring-index) 0)
160 (set (make-local-variable 'comint-last-input-end) (make-marker)) 160 (set (make-local-variable 'comint-last-input-end) (make-marker))
161 (set-marker comint-last-input-end (point-max)) 161 (set-marker comint-last-input-end (point-max))
175 (defun make-comint (name program &optional startfile &rest switches) 175 (defun make-comint (name program &optional startfile &rest switches)
176 (let* ((buffer (get-buffer-create (concat "*" name "*"))) 176 (let* ((buffer (get-buffer-create (concat "*" name "*")))
177 (proc (get-buffer-process buffer))) 177 (proc (get-buffer-process buffer)))
178 ;; If no process, or nuked process, crank up a new one and put buffer in 178 ;; If no process, or nuked process, crank up a new one and put buffer in
179 ;; comint mode. Otherwise, leave buffer and existing process alone. 179 ;; comint mode. Otherwise, leave buffer and existing process alone.
180 (cond ((not (comint-check-proc)) 180 (cond ((not (comint-check-proc buffer))
181 (save-excursion 181 (save-excursion
182 (set-buffer buffer) 182 (set-buffer buffer)
183 (comint-mode)) ; Install local vars, mode, keymap, ... 183 (comint-mode)) ; Install local vars, mode, keymap, ...
184 (comint-exec buffer name program startfile switches))) 184 (comint-exec buffer name program startfile switches)))
185 buffer)) 185 buffer))
207 (sleep-for 1) 207 (sleep-for 1)
208 (goto-char (point-max)) 208 (goto-char (point-max))
209 (insert-file-contents startfile) 209 (insert-file-contents startfile)
210 (setq startfile (buffer-substring (point) (point-max))) 210 (setq startfile (buffer-substring (point) (point-max)))
211 (delete-region (point) (point-max)) 211 (delete-region (point) (point-max))
212 (comint-send-string proc startfile))) 212 (comint-send-string proc startfile))))
213 buffer)) 213 buffer))
214 214
215 ;;; This auxiliary function cranks up the process for comint-exec in 215 ;;; This auxiliary function cranks up the process for comint-exec in
216 ;;; the appropriate environment. It is twice as long as it should be 216 ;;; the appropriate environment. It is twice as long as it should be
217 ;;; because emacs has two distinct mechanisms for manipulating the 217 ;;; because emacs has two distinct mechanisms for manipulating the