]> git.eshelyaron.com Git - emacs.git/commitdiff
(comint-skip-input): New function.
authorRichard M. Stallman <rms@gnu.org>
Sat, 15 Jun 2002 14:26:06 +0000 (14:26 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 15 Jun 2002 14:26:06 +0000 (14:26 +0000)
(comint-interrupt-subjob, comint-kill-subjob, comint-quit-subjob)
(comint-stop-subjob): Use comint-skip-input.

lisp/comint.el

index 6840e4d6c5addcb659a5312249e4132e1f889051..f864da964968cc18d6452a2eede94ac207020a4f 100644 (file)
@@ -2059,7 +2059,7 @@ Sets mark to the value of point when this command is run."
 This command also kills the pending input
 between the process-mark and point."
   (interactive)
-  (comint-kill-input)
+  (comint-skip-input)
   (interrupt-process nil comint-ptyp))
 
 (defun comint-kill-subjob ()
@@ -2067,7 +2067,7 @@ between the process-mark and point."
 This command also kills the pending input
 between the process-mark and point."
   (interactive)
-  (comint-kill-input)
+  (comint-skip-input)
   (kill-process nil comint-ptyp))
 
 (defun comint-quit-subjob ()
@@ -2075,7 +2075,7 @@ between the process-mark and point."
 This command also kills the pending input
 between the process-mark and point."
   (interactive)
-  (comint-kill-input)
+  (comint-skip-input)
   (quit-process nil comint-ptyp))
 
 (defun comint-stop-subjob ()
@@ -2088,7 +2088,7 @@ the top-level process running in the buffer. If you accidentally do
 this, use \\[comint-continue-subjob] to resume the process. (This
 is not a problem with most shells, since they ignore this signal.)"
   (interactive)
-  (comint-kill-input)
+  (comint-skip-input)
   (stop-process nil comint-ptyp))
 
 (defun comint-continue-subjob ()
@@ -2097,6 +2097,19 @@ Useful if you accidentally suspend the top-level process."
   (interactive)
   (continue-process nil comint-ptyp))
 
+(defun comint-skip-input ()
+  "Skip all pending input, from last stuff output by interpreter to point.
+This means mark it as if it had been sent as input, without sending it."
+  (let ((comint-input-sender 'ignore)
+       (comint-input-filter-functions nil))
+    (comint-send-input t))
+  (end-of-line)
+  (let ((pos (point))
+       (marker (process-mark (get-buffer-process (current-buffer)))))
+    (insert "  " (key-description (this-command-keys)))
+    (if (= marker pos)
+       (set-marker marker (point)))))
+
 (defun comint-kill-input ()
   "Kill all text from last stuff output by interpreter to point."
   (interactive)