aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-04-10 23:26:57 +0000
committerRichard M. Stallman2005-04-10 23:26:57 +0000
commit819555b068cbaff9fc62b2adf1397e2129cdea82 (patch)
treef9c7086389e3a03d46ebd79f4e68794c6d0dc523
parent2f229dc43ad058d014032bd5d06be50ac4358cb9 (diff)
downloademacs-819555b068cbaff9fc62b2adf1397e2129cdea82.tar.gz
emacs-819555b068cbaff9fc62b2adf1397e2129cdea82.zip
(comint-send-input): New arg ARTIFICIAL. Callers in this file changed.
-rw-r--r--lisp/comint.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index f3f98b0500f..fe0987e2076 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1388,14 +1388,15 @@ Ignore duplicates if `comint-input-ignoredups' is non-nil."
1388 cmd)))) 1388 cmd))))
1389 (ring-insert comint-input-ring cmd))) 1389 (ring-insert comint-input-ring cmd)))
1390 1390
1391(defun comint-send-input (&optional no-newline) 1391(defun comint-send-input (&optional no-newline artificial)
1392 "Send input to process. 1392 "Send input to process.
1393After the process output mark, sends all text from the process mark to 1393After the process output mark, sends all text from the process mark to
1394point as input to the process. Before the process output mark, calls 1394point as input to the process. Before the process output mark, calls
1395value of variable `comint-get-old-input' to retrieve old input, copies 1395value of variable `comint-get-old-input' to retrieve old input, copies
1396it to the process mark, and sends it. A terminal newline is also 1396it to the process mark, and sends it.
1397inserted into the buffer and sent to the process unless NO-NEWLINE is 1397
1398non-nil. 1398This command also sends and inserts a final newline, unless
1399NO-NEWLINE is non-nil.
1399 1400
1400Any history reference may be expanded depending on the value of the variable 1401Any history reference may be expanded depending on the value of the variable
1401`comint-input-autoexpand'. The list of function names contained in the value 1402`comint-input-autoexpand'. The list of function names contained in the value
@@ -1409,6 +1410,8 @@ end of line before sending the input.
1409After the input has been sent, if `comint-process-echoes' is non-nil, 1410After the input has been sent, if `comint-process-echoes' is non-nil,
1410then `comint-send-input' waits to see if the process outputs a string 1411then `comint-send-input' waits to see if the process outputs a string
1411matching the input, and if so, deletes that part of the output. 1412matching the input, and if so, deletes that part of the output.
1413If ARTIFICIAL is non-nil, it inhibits such deletion.
1414Callers sending input not from the user should use ARTIFICIAL = t.
1412 1415
1413The values of `comint-get-old-input', `comint-input-filter-functions', and 1416The values of `comint-get-old-input', `comint-input-filter-functions', and
1414`comint-input-filter' are chosen according to the command interpreter running 1417`comint-input-filter' are chosen according to the command interpreter running
@@ -1513,7 +1516,7 @@ Similarly for Soar, Scheme, etc."
1513 (funcall comint-input-sender proc input)) 1516 (funcall comint-input-sender proc input))
1514 1517
1515 ;; Optionally delete echoed input (after checking it). 1518 ;; Optionally delete echoed input (after checking it).
1516 (when comint-process-echoes 1519 (when (and comint-process-echoes (not artificial))
1517 (let ((echo-len (- comint-last-input-end 1520 (let ((echo-len (- comint-last-input-end
1518 comint-last-input-start))) 1521 comint-last-input-start)))
1519 ;; Wait for all input to be echoed: 1522 ;; Wait for all input to be echoed:
@@ -2088,7 +2091,7 @@ Useful if you accidentally suspend the top-level process."
2088This means mark it as if it had been sent as input, without sending it." 2091This means mark it as if it had been sent as input, without sending it."
2089 (let ((comint-input-sender 'ignore) 2092 (let ((comint-input-sender 'ignore)
2090 (comint-input-filter-functions nil)) 2093 (comint-input-filter-functions nil))
2091 (comint-send-input t)) 2094 (comint-send-input t t))
2092 (end-of-line) 2095 (end-of-line)
2093 (let ((pos (point)) 2096 (let ((pos (point))
2094 (marker (process-mark (get-buffer-process (current-buffer))))) 2097 (marker (process-mark (get-buffer-process (current-buffer)))))
@@ -2115,7 +2118,7 @@ Sends an EOF only if point is at the end of the buffer and there is no input."
2115(defun comint-send-eof () 2118(defun comint-send-eof ()
2116 "Send an EOF to the current buffer's process." 2119 "Send an EOF to the current buffer's process."
2117 (interactive) 2120 (interactive)
2118 (comint-send-input t) 2121 (comint-send-input t t)
2119 (process-send-eof)) 2122 (process-send-eof))
2120 2123
2121 2124