]> git.eshelyaron.com Git - emacs.git/commitdiff
(comint-send-string, comint-send-region): Also accept a buffer, buffer-name,
authorMiles Bader <miles@gnu.org>
Fri, 15 Dec 2000 14:09:22 +0000 (14:09 +0000)
committerMiles Bader <miles@gnu.org>
Fri, 15 Dec 2000 14:09:22 +0000 (14:09 +0000)
or nil for PROCESS, for compatibility with process-send-string/region.

lisp/comint.el

index f3922f3407dc32e9e015e2531ed8c3a23a4dc075..33595103a01a3cb8ab7183e7578e9a5653cc149b 100644 (file)
@@ -1878,13 +1878,21 @@ This function could be in the list `comint-output-filter-functions'."
 
 (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))
 \f