comparison lisp/comint.el @ 90143:146c086df160

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-37 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 241-257) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 59-65) - Update from CVS - Merge from emacs--cvs-trunk--0 - (mm-string-to-multibyte): Use Gnus trunk definition.
author Miles Bader <miles@gnu.org>
date Thu, 14 Apr 2005 05:03:52 +0000
parents 02f1dbc4a199 a8e7bc540c1c
children e1fbb019c538
comparison
equal deleted inserted replaced
90142:627771f44771 90143:146c086df160
1386 (ring-empty-p comint-input-ring) 1386 (ring-empty-p comint-input-ring)
1387 (not (string-equal (ring-ref comint-input-ring 0) 1387 (not (string-equal (ring-ref comint-input-ring 0)
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
1402 of `comint-input-filter-functions' is called on the input before sending it. 1403 of `comint-input-filter-functions' is called on the input before sending it.
1403 The input is entered into the input history ring, if the value of variable 1404 The input is entered into the input history ring, if the value of variable
1407 end of line before sending the input. 1408 end of line before sending the input.
1408 1409
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
1415 in the buffer. E.g., 1418 in the buffer. E.g.,
1416 1419
1511 (set-marker comint-accum-marker nil) 1514 (set-marker comint-accum-marker nil)
1512 (let ((comint-input-sender-no-newline no-newline)) 1515 (let ((comint-input-sender-no-newline no-newline))
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:
1520 (while (and (accept-process-output proc) 1523 (while (and (accept-process-output proc)
1521 (> (+ comint-last-input-end echo-len) 1524 (> (+ comint-last-input-end echo-len)
2086 (defun comint-skip-input () 2089 (defun comint-skip-input ()
2087 "Skip all pending input, from last stuff output by interpreter to point. 2090 "Skip all pending input, from last stuff output by interpreter to point.
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)))))
2095 (insert " " (key-description (this-command-keys))) 2098 (insert " " (key-description (this-command-keys)))
2096 (if (= marker pos) 2099 (if (= marker pos)
2113 (delete-char arg)))) 2116 (delete-char arg))))
2114 2117
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
2122 (defun comint-backward-matching-input (regexp n) 2125 (defun comint-backward-matching-input (regexp n)
2123 "Search backward through buffer for input fields that match REGEXP. 2126 "Search backward through buffer for input fields that match REGEXP.