aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2002-06-15 14:26:06 +0000
committerRichard M. Stallman2002-06-15 14:26:06 +0000
commit3fdbf632230ba121f6625971bbe4a09608d59505 (patch)
tree152411f275f23556438d6d64ad34af80564627b7
parent72695e4715e5094196670ef23ad6152b51267649 (diff)
downloademacs-3fdbf632230ba121f6625971bbe4a09608d59505.tar.gz
emacs-3fdbf632230ba121f6625971bbe4a09608d59505.zip
(comint-skip-input): New function.
(comint-interrupt-subjob, comint-kill-subjob, comint-quit-subjob) (comint-stop-subjob): Use comint-skip-input.
-rw-r--r--lisp/comint.el21
1 files changed, 17 insertions, 4 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 6840e4d6c5a..f864da96496 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2059,7 +2059,7 @@ Sets mark to the value of point when this command is run."
2059This command also kills the pending input 2059This command also kills the pending input
2060between the process-mark and point." 2060between the process-mark and point."
2061 (interactive) 2061 (interactive)
2062 (comint-kill-input) 2062 (comint-skip-input)
2063 (interrupt-process nil comint-ptyp)) 2063 (interrupt-process nil comint-ptyp))
2064 2064
2065(defun comint-kill-subjob () 2065(defun comint-kill-subjob ()
@@ -2067,7 +2067,7 @@ between the process-mark and point."
2067This command also kills the pending input 2067This command also kills the pending input
2068between the process-mark and point." 2068between the process-mark and point."
2069 (interactive) 2069 (interactive)
2070 (comint-kill-input) 2070 (comint-skip-input)
2071 (kill-process nil comint-ptyp)) 2071 (kill-process nil comint-ptyp))
2072 2072
2073(defun comint-quit-subjob () 2073(defun comint-quit-subjob ()
@@ -2075,7 +2075,7 @@ between the process-mark and point."
2075This command also kills the pending input 2075This command also kills the pending input
2076between the process-mark and point." 2076between the process-mark and point."
2077 (interactive) 2077 (interactive)
2078 (comint-kill-input) 2078 (comint-skip-input)
2079 (quit-process nil comint-ptyp)) 2079 (quit-process nil comint-ptyp))
2080 2080
2081(defun comint-stop-subjob () 2081(defun comint-stop-subjob ()
@@ -2088,7 +2088,7 @@ the top-level process running in the buffer. If you accidentally do
2088this, use \\[comint-continue-subjob] to resume the process. (This 2088this, use \\[comint-continue-subjob] to resume the process. (This
2089is not a problem with most shells, since they ignore this signal.)" 2089is not a problem with most shells, since they ignore this signal.)"
2090 (interactive) 2090 (interactive)
2091 (comint-kill-input) 2091 (comint-skip-input)
2092 (stop-process nil comint-ptyp)) 2092 (stop-process nil comint-ptyp))
2093 2093
2094(defun comint-continue-subjob () 2094(defun comint-continue-subjob ()
@@ -2097,6 +2097,19 @@ Useful if you accidentally suspend the top-level process."
2097 (interactive) 2097 (interactive)
2098 (continue-process nil comint-ptyp)) 2098 (continue-process nil comint-ptyp))
2099 2099
2100(defun comint-skip-input ()
2101 "Skip all pending input, from last stuff output by interpreter to point.
2102This means mark it as if it had been sent as input, without sending it."
2103 (let ((comint-input-sender 'ignore)
2104 (comint-input-filter-functions nil))
2105 (comint-send-input t))
2106 (end-of-line)
2107 (let ((pos (point))
2108 (marker (process-mark (get-buffer-process (current-buffer)))))
2109 (insert " " (key-description (this-command-keys)))
2110 (if (= marker pos)
2111 (set-marker marker (point)))))
2112
2100(defun comint-kill-input () 2113(defun comint-kill-input ()
2101 "Kill all text from last stuff output by interpreter to point." 2114 "Kill all text from last stuff output by interpreter to point."
2102 (interactive) 2115 (interactive)