From: Miles Bader Date: Fri, 15 Dec 2000 14:09:22 +0000 (+0000) Subject: (comint-send-string, comint-send-region): Also accept a buffer, buffer-name, X-Git-Tag: emacs-pretest-21.0.95~488 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9f626345277be1904d29e14483c141c7302a4ed5;p=emacs.git (comint-send-string, comint-send-region): Also accept a buffer, buffer-name, or nil for PROCESS, for compatibility with process-send-string/region. --- diff --git a/lisp/comint.el b/lisp/comint.el index f3922f3407d..33595103a01 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -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))