aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorLars Ingebrigtsen2022-05-07 18:21:29 +0200
committerLars Ingebrigtsen2022-05-07 18:21:29 +0200
commitfc0bd6057c676b9945aa739dd9365a350ca5acef (patch)
tree70e4587f7fa5831b82b414eb4b64b9ea395d5daf /src/process.c
parent2e461ab2dcb407c868a38d833f38815c17a28c5a (diff)
downloademacs-fc0bd6057c676b9945aa739dd9365a350ca5acef.tar.gz
emacs-fc0bd6057c676b9945aa739dd9365a350ca5acef.zip
Make 'delete-process' into a command
* doc/lispref/processes.texi (Deleting Processes): Document missing PROCESS value. * src/process.c (Fdelete_process): Allow calling interactively (bug#10107).
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/process.c b/src/process.c
index 08a02ad9423..2f8863aef25 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1071,13 +1071,24 @@ record_deleted_pid (pid_t pid, Lisp_Object filename)
1071 1071
1072} 1072}
1073 1073
1074DEFUN ("delete-process", Fdelete_process, Sdelete_process, 1, 1, 0, 1074DEFUN ("delete-process", Fdelete_process, Sdelete_process, 0, 1,
1075 "(list 'message)",
1075 doc: /* Delete PROCESS: kill it and forget about it immediately. 1076 doc: /* Delete PROCESS: kill it and forget about it immediately.
1076PROCESS may be a process, a buffer, the name of a process or buffer, or 1077PROCESS may be a process, a buffer, the name of a process or buffer, or
1077nil, indicating the current buffer's process. */) 1078nil, indicating the current buffer's process.
1079
1080Interactively, it will kill the current buffer's process. */)
1078 (register Lisp_Object process) 1081 (register Lisp_Object process)
1079{ 1082{
1080 register struct Lisp_Process *p; 1083 register struct Lisp_Process *p;
1084 bool mess = false;
1085
1086 /* We use this to see whether we were called interactively. */
1087 if (EQ (process, Qmessage))
1088 {
1089 mess = true;
1090 process = Qnil;
1091 }
1081 1092
1082 process = get_process (process); 1093 process = get_process (process);
1083 p = XPROCESS (process); 1094 p = XPROCESS (process);
@@ -1131,6 +1142,8 @@ nil, indicating the current buffer's process. */)
1131 } 1142 }
1132 } 1143 }
1133 remove_process (process); 1144 remove_process (process);
1145 if (mess)
1146 message ("Deleted process");
1134 return Qnil; 1147 return Qnil;
1135} 1148}
1136 1149
@@ -8637,6 +8650,7 @@ sentinel or a process filter function has an error. */);
8637 8650
8638 DEFSYM (Qnull, "null"); 8651 DEFSYM (Qnull, "null");
8639 DEFSYM (Qpipe_process_p, "pipe-process-p"); 8652 DEFSYM (Qpipe_process_p, "pipe-process-p");
8653 DEFSYM (Qmessage, "message");
8640 8654
8641 defsubr (&Sprocessp); 8655 defsubr (&Sprocessp);
8642 defsubr (&Sget_process); 8656 defsubr (&Sget_process);