To add or remove elements of this list, see
`eshell-record-process-object' and `eshell-remove-process-entry'.")
+(declare-function eshell-reset "esh-mode" (&optional no-hooks))
(declare-function eshell-send-eof-to-process "esh-mode")
(declare-function eshell-interactive-filter "esh-mode" (buffer string))
(declare-function eshell-tail-process "esh-cmd")
(make-local-variable 'eshell-process-list)
(eshell-proc-mode))
-(defun eshell-reset-after-proc (status)
- "Reset the command input location after a process terminates.
-The signals which will cause this to happen are matched by
-`eshell-reset-signals'."
- (declare (obsolete nil "30.1"))
- (when (and (stringp status)
- (string-match eshell-reset-signals status))
- (require 'esh-mode)
- (declare-function eshell-reset "esh-mode" (&optional no-hooks))
- (eshell-reset)))
+(define-obsolete-function-alias 'eshell-reset-after-proc
+ 'eshell--reset-after-signal "30.1")
(defun eshell-process-active-p (process)
"Return non-nil if PROCESS is active.
(kill-buffer buf)))
(message nil))))
+(defun eshell--reset-after-signal (status)
+ "Reset the prompt after a signal when necessary.
+STATUS is the status associated with the signal; if
+`eshell-reset-signals' matches status, reset the prompt.
+
+This is really only useful when \"signaling\" while there's no
+foreground process. Otherwise, `eshell-resume-command' handles
+everything."
+ (when (and (stringp status)
+ (string-match eshell-reset-signals status))
+ (eshell-reset)))
+
(defun eshell-interrupt-process ()
"Interrupt a process."
(interactive)
(unless (eshell-process-interact 'interrupt-process)
- (run-hook-with-args 'eshell-kill-hook nil "interrupt")))
+ (eshell--reset-after-signal "interrupt\n")))
(defun eshell-kill-process ()
"Kill a process."
(interactive)
(unless (eshell-process-interact 'kill-process)
- (run-hook-with-args 'eshell-kill-hook nil "killed")))
+ (eshell--reset-after-signal "killed\n")))
(defun eshell-quit-process ()
"Send quit signal to process."
(interactive)
(unless (eshell-process-interact 'quit-process)
- (run-hook-with-args 'eshell-kill-hook nil "quit")))
+ (eshell--reset-after-signal "quit\n")))
;(defun eshell-stop-process ()
; "Send STOP signal to process."
; (interactive)
; (unless (eshell-process-interact 'stop-process)
-; (run-hook-with-args 'eshell-kill-hook nil "stopped")))
+; (eshell--reset-after-signal "stopped\n")))
;(defun eshell-continue-process ()
; "Send CONTINUE signal to process."
; ;; jww (1999-09-17): this signal is not dealt with yet. For
; ;; example, `eshell-reset' will be called, and so will
; ;; `eshell-resume-eval'.
-; (run-hook-with-args 'eshell-kill-hook nil "continue")))
+; (eshell--reset-after-signal "continue\n")))
(provide 'esh-proc)
;;; esh-proc.el ends here