diff options
| author | Richard M. Stallman | 2005-04-10 23:26:57 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-04-10 23:26:57 +0000 |
| commit | 819555b068cbaff9fc62b2adf1397e2129cdea82 (patch) | |
| tree | f9c7086389e3a03d46ebd79f4e68794c6d0dc523 | |
| parent | 2f229dc43ad058d014032bd5d06be50ac4358cb9 (diff) | |
| download | emacs-819555b068cbaff9fc62b2adf1397e2129cdea82.tar.gz emacs-819555b068cbaff9fc62b2adf1397e2129cdea82.zip | |
(comint-send-input): New arg ARTIFICIAL. Callers in this file changed.
| -rw-r--r-- | lisp/comint.el | 17 |
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. |
| 1393 | After the process output mark, sends all text from the process mark to | 1393 | After the process output mark, sends all text from the process mark to |
| 1394 | point as input to the process. Before the process output mark, calls | 1394 | point as input to the process. Before the process output mark, calls |
| 1395 | value of variable `comint-get-old-input' to retrieve old input, copies | 1395 | value of variable `comint-get-old-input' to retrieve old input, copies |
| 1396 | it to the process mark, and sends it. A terminal newline is also | 1396 | it to the process mark, and sends it. |
| 1397 | inserted into the buffer and sent to the process unless NO-NEWLINE is | 1397 | |
| 1398 | non-nil. | 1398 | This command also sends and inserts a final newline, unless |
| 1399 | NO-NEWLINE is non-nil. | ||
| 1399 | 1400 | ||
| 1400 | Any history reference may be expanded depending on the value of the variable | 1401 | Any 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. | |||
| 1409 | After the input has been sent, if `comint-process-echoes' is non-nil, | 1410 | After the input has been sent, if `comint-process-echoes' is non-nil, |
| 1410 | then `comint-send-input' waits to see if the process outputs a string | 1411 | then `comint-send-input' waits to see if the process outputs a string |
| 1411 | matching the input, and if so, deletes that part of the output. | 1412 | matching the input, and if so, deletes that part of the output. |
| 1413 | If ARTIFICIAL is non-nil, it inhibits such deletion. | ||
| 1414 | Callers sending input not from the user should use ARTIFICIAL = t. | ||
| 1412 | 1415 | ||
| 1413 | The values of `comint-get-old-input', `comint-input-filter-functions', and | 1416 | The 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." | |||
| 2088 | This means mark it as if it had been sent as input, without sending it." | 2091 | This 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 | ||