they exit.
@end defopt
-@defun delete-process process
+@defun delete-process &optional process
This function deletes a process, killing it with a @code{SIGKILL}
signal if the process was running a program. The argument may be a
process, the name of a process, a buffer, or the name of a buffer. (A
buffer or buffer-name stands for the process that
-@code{get-buffer-process} returns.) Calling @code{delete-process} on
-a running process terminates it, updates the process status, and runs
-the sentinel immediately. If the process has already terminated,
-calling @code{delete-process} has no effect on its status, or on the
-running of its sentinel (which will happen sooner or later).
+@code{get-buffer-process} returns, and a missing or @code{nil}
+@var{process} means that the current buffer's process should be
+killed.) Calling @code{delete-process} on a running process
+terminates it, updates the process status, and runs the sentinel
+immediately. If the process has already terminated, calling
+@code{delete-process} has no effect on its status, or on the running
+of its sentinel (which will happen sooner or later).
If the process object represents a network, serial, or pipe
connection, its status changes to @code{closed}; otherwise, it changes
\f
* Changes in Emacs 29.1
+---
+** 'delete-process' is now a command.
+When called interactively, it will kill the process running in the
+current buffer (if any). This can be useful if you have runaway
+output in the current buffer (from a process or a network connection),
+and want to stop it.
+
+++
** New command 'restart-emacs'.
This is like 'save-buffers-kill-emacs', but instead of just killing
}
-DEFUN ("delete-process", Fdelete_process, Sdelete_process, 1, 1, 0,
+DEFUN ("delete-process", Fdelete_process, Sdelete_process, 0, 1,
+ "(list 'message)",
doc: /* Delete PROCESS: kill it and forget about it immediately.
PROCESS may be a process, a buffer, the name of a process or buffer, or
-nil, indicating the current buffer's process. */)
+nil, indicating the current buffer's process.
+
+Interactively, it will kill the current buffer's process. */)
(register Lisp_Object process)
{
register struct Lisp_Process *p;
+ bool mess = false;
+
+ /* We use this to see whether we were called interactively. */
+ if (EQ (process, Qmessage))
+ {
+ mess = true;
+ process = Qnil;
+ }
process = get_process (process);
p = XPROCESS (process);
}
}
remove_process (process);
+ if (mess)
+ message ("Deleted process");
return Qnil;
}
\f
DEFSYM (Qnull, "null");
DEFSYM (Qpipe_process_p, "pipe-process-p");
+ DEFSYM (Qmessage, "message");
defsubr (&Sprocessp);
defsubr (&Sget_process);