changeset 34606:52fc3d972e9c

(comint-send-string, comint-send-region): Also accept a buffer, buffer-name, or nil for PROCESS, for compatibility with process-send-string/region.
author Miles Bader <miles@gnu.org>
date Fri, 15 Dec 2000 14:09:22 +0000
parents 8b318d7f5f2a
children 4d0a388c5e67
files lisp/comint.el
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/comint.el	Fri Dec 15 13:59:46 2000 +0000
+++ b/lisp/comint.el	Fri Dec 15 14:09:22 2000 +0000
@@ -1878,13 +1878,21 @@
 
 (defun comint-send-string (process string)
   "Like `process-send-string', but also does extra bookkeeping for comint mode."
-  (with-current-buffer (process-buffer process)
+  (if process
+      (with-current-buffer (if (processp process)
+			       (process-buffer process)
+			     (get-buffer process))
+	(comint-snapshot-last-prompt))
     (comint-snapshot-last-prompt))
   (process-send-string process string))
 
 (defun comint-send-region (process start end)
   "Like `process-send-region', but also does extra bookkeeping for comint mode."
-  (with-current-buffer (process-buffer process)
+  (if process
+      (with-current-buffer (if (processp process)
+			       (process-buffer process)
+			     (get-buffer process))
+	(comint-snapshot-last-prompt))
     (comint-snapshot-last-prompt))
   (process-send-region process start end))