comparison lisp/comint.el @ 45836:e4a48b5ab2fb

(comint-skip-input): New function. (comint-interrupt-subjob, comint-kill-subjob, comint-quit-subjob) (comint-stop-subjob): Use comint-skip-input.
author Richard M. Stallman <rms@gnu.org>
date Sat, 15 Jun 2002 14:26:06 +0000
parents ffa13f09e36d
children 875b299f29c6
comparison
equal deleted inserted replaced
45835:aab759361c24 45836:e4a48b5ab2fb
2057 (defun comint-interrupt-subjob () 2057 (defun comint-interrupt-subjob ()
2058 "Interrupt the current subjob. 2058 "Interrupt the current subjob.
2059 This command also kills the pending input 2059 This command also kills the pending input
2060 between the process-mark and point." 2060 between 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 ()
2066 "Send kill signal to the current subjob. 2066 "Send kill signal to the current subjob.
2067 This command also kills the pending input 2067 This command also kills the pending input
2068 between the process-mark and point." 2068 between 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 ()
2074 "Send quit signal to the current subjob. 2074 "Send quit signal to the current subjob.
2075 This command also kills the pending input 2075 This command also kills the pending input
2076 between the process-mark and point." 2076 between 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 ()
2082 "Stop the current subjob. 2082 "Stop the current subjob.
2083 This command also kills the pending input 2083 This command also kills the pending input
2086 WARNING: if there is no current subjob, you can end up suspending 2086 WARNING: if there is no current subjob, you can end up suspending
2087 the top-level process running in the buffer. If you accidentally do 2087 the top-level process running in the buffer. If you accidentally do
2088 this, use \\[comint-continue-subjob] to resume the process. (This 2088 this, use \\[comint-continue-subjob] to resume the process. (This
2089 is not a problem with most shells, since they ignore this signal.)" 2089 is 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 ()
2095 "Send CONT signal to process buffer's process group. 2095 "Send CONT signal to process buffer's process group.
2096 Useful if you accidentally suspend the top-level process." 2096 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
2100 (defun comint-skip-input ()
2101 "Skip all pending input, from last stuff output by interpreter to point.
2102 This 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)))))
2099 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)
2103 (let ((pmark (process-mark (get-buffer-process (current-buffer))))) 2116 (let ((pmark (process-mark (get-buffer-process (current-buffer)))))