aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1992-09-13 21:51:49 +0000
committerRichard M. Stallman1992-09-13 21:51:49 +0000
commitc9706a52b3ab3185e11b4e7da421e6271a400e96 (patch)
tree5e72cfab1ba3252022f2b488a9d28d26e836703f
parent715984d3a4be50954a28e9a6fd270986d319826d (diff)
downloademacs-c9706a52b3ab3185e11b4e7da421e6271a400e96.tar.gz
emacs-c9706a52b3ab3185e11b4e7da421e6271a400e96.zip
entered into RCS
-rw-r--r--lisp/comint.el34
1 files changed, 12 insertions, 22 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 3837ac1cf29..86fe60fbedc 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -108,6 +108,7 @@
108 108
109(defconst comint-version "2.03") 109(defconst comint-version "2.03")
110 110
111(require 'ring)
111 112
112;;; Buffer Local Variables: 113;;; Buffer Local Variables:
113;;;============================================================================ 114;;;============================================================================
@@ -184,9 +185,16 @@ executed once when the buffer is created.")
184 185
185(defvar comint-mode-map nil) 186(defvar comint-mode-map nil)
186 187
188(defvar comint-ptyp t
189 "True if communications via pty; false if by pipe. Buffer local.
190This is to work around a bug in emacs process signalling.")
191
187(defvar comint-input-ring nil) 192(defvar comint-input-ring nil)
188(defvar comint-last-input-start) 193(defvar comint-last-input-start)
189(defvar comint-last-input-end) 194(defvar comint-last-input-end)
195(defvar comint-input-ring-index)
196(put 'comint-input-ring 'permanent-local t)
197(put 'comint-ptyp 'permanent-local t)
190 198
191(defun comint-mode () 199(defun comint-mode ()
192 "Major mode for interacting with an inferior interpreter. 200 "Major mode for interacting with an inferior interpreter.
@@ -215,11 +223,8 @@ to continue it.
215 223
216Entry to this mode runs the hooks on comint-mode-hook" 224Entry to this mode runs the hooks on comint-mode-hook"
217 (interactive) 225 (interactive)
218 (let ((old-ring (and (assq 'comint-input-ring (buffer-local-variables)) 226 ;; Do not remove this. All major modes must do this.
219 (boundp 'comint-input-ring) 227 (kill-all-local-variables)
220 comint-input-ring))
221 (old-ptyp comint-ptyp)) ; preserve across local var kill. gross.
222; (kill-all-local-variables) ; Removed 1/15/90 Olin
223 (setq major-mode 'comint-mode) 228 (setq major-mode 'comint-mode)
224 (setq mode-name "Comint") 229 (setq mode-name "Comint")
225 (setq mode-line-process '(": %s")) 230 (setq mode-line-process '(": %s"))
@@ -241,21 +246,10 @@ Entry to this mode runs the hooks on comint-mode-hook"
241 (make-local-variable 'comint-input-sender) 246 (make-local-variable 'comint-input-sender)
242 (make-local-variable 'comint-eol-on-send) 247 (make-local-variable 'comint-eol-on-send)
243 (make-local-variable 'comint-ptyp) 248 (make-local-variable 'comint-ptyp)
244 (setq comint-ptyp old-ptyp)
245 (make-local-variable 'comint-exec-hook) 249 (make-local-variable 'comint-exec-hook)
246 (run-hooks 'comint-mode-hook) 250 (run-hooks 'comint-mode-hook)
247 ;Do this after the hook so the user can mung COMINT-INPUT-RING-SIZE w/his hook. 251 (or comint-input-ring
248 ;The test is so we don't lose history if we run comint-mode twice in 252 (setq comint-input-ring (make-ring comint-input-ring-size))))
249 ;a buffer.
250 (setq comint-input-ring (if (ring-p old-ring) old-ring
251 (make-ring comint-input-ring-size)))))
252
253;;; The old-ptyp stuff above is because we have to preserve the value of
254;;; comint-ptyp across calls to comint-mode, in spite of the
255;;; kill-all-local-variables that it does. Blech. Hopefully, this will all
256;;; go away when a later release fixes the signalling bug.
257;;; (Later: I removed the kill-all-local-variables, but have left this
258;;; other code in place just in case I reverse myself.)
259 253
260(if comint-mode-map 254(if comint-mode-map
261 nil 255 nil
@@ -313,10 +307,6 @@ name of one"
313 (comint-exec buffer name program startfile switches))) 307 (comint-exec buffer name program startfile switches)))
314 buffer)) 308 buffer))
315 309
316(defvar comint-ptyp t
317 "True if communications via pty; false if by pipe. Buffer local.
318This is to work around a bug in emacs process signalling.")
319
320(defun comint-exec (buffer name command startfile switches) 310(defun comint-exec (buffer name command startfile switches)
321 "Fires up a process in buffer for comint modes. 311 "Fires up a process in buffer for comint modes.
322Blasts any old process running in the buffer. Doesn't set the buffer mode. 312Blasts any old process running in the buffer. Doesn't set the buffer mode.