diff options
| author | Michael Albinus | 2022-03-30 13:16:54 +0200 |
|---|---|---|
| committer | Michael Albinus | 2022-03-30 13:16:54 +0200 |
| commit | 2212b42806757957fff6a9646debddecb301241c (patch) | |
| tree | 8ded1ebd36764c9f8253e60d672b693716a38e21 /src/process.c | |
| parent | c0f5e0a559bab530d6a2e1de3bb021d004a855cf (diff) | |
| download | emacs-2212b42806757957fff6a9646debddecb301241c.tar.gz emacs-2212b42806757957fff6a9646debddecb301241c.zip | |
Extend signal-process and proced.el
* doc/lispref/processes.texi (Signals to Processes):
Document changes in signal-process.
* etc/NEWS: Mention changes in proced.el and signal-process.
* lisp/proced.el (proced-signal-function): Declare it obsolete.
(proced-remote-directory): New user option.
(proced-mode): Adapt docstring.
(proced-send-signal, proced-renice): Handle interactive prefix argument.
* lisp/net/tramp.el (tramp-signal-process): New defun. Add it to
`signal-process-functions'.
* src/process.c (Finternal_default_signal_process): New defun,
providing the hitherto existing implementation of Fsignal_process.
(Fsignal_process): Loop through Vsignal_process_functions.
(Vsignal_process_functions): New defvar.
(Qinternal_default_signal_process, Qsignal_process_functions):
Declare symbols.
(Sinternal_default_signal_process): Declare subroutine.
* test/lisp/net/tramp-tests.el (tramp-test31-signal-process): New test.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/src/process.c b/src/process.c index 993e1c56038..e8aafd02d74 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -7034,14 +7034,13 @@ abbr_to_signal (char const *name) | |||
| 7034 | return -1; | 7034 | return -1; |
| 7035 | } | 7035 | } |
| 7036 | 7036 | ||
| 7037 | DEFUN ("signal-process", Fsignal_process, Ssignal_process, | 7037 | DEFUN ("internal-default-signal-process", |
| 7038 | 2, 2, "sProcess (name or number): \nnSignal code: ", | 7038 | Finternal_default_signal_process, |
| 7039 | doc: /* Send PROCESS the signal with code SIGCODE. | 7039 | Sinternal_default_signal_process, 2, 3, 0, |
| 7040 | PROCESS may also be a number specifying the process id of the | 7040 | doc: /* Default function to send PROCESS the signal with code SIGCODE. |
| 7041 | process to signal; in this case, the process need not be a child of | 7041 | It shall be the last element in list `signal-process-functions'. |
| 7042 | this Emacs. | 7042 | See function `signal-process' for more details on usage. */) |
| 7043 | SIGCODE may be an integer, or a symbol whose name is a signal name. */) | 7043 | (Lisp_Object process, Lisp_Object sigcode, Lisp_Object remote) |
| 7044 | (Lisp_Object process, Lisp_Object sigcode) | ||
| 7045 | { | 7044 | { |
| 7046 | pid_t pid; | 7045 | pid_t pid; |
| 7047 | int signo; | 7046 | int signo; |
| @@ -7091,6 +7090,23 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */) | |||
| 7091 | return make_fixnum (kill (pid, signo)); | 7090 | return make_fixnum (kill (pid, signo)); |
| 7092 | } | 7091 | } |
| 7093 | 7092 | ||
| 7093 | DEFUN ("signal-process", Fsignal_process, Ssignal_process, | ||
| 7094 | 2, 3, "sProcess (name or number): \nnSignal code: ", | ||
| 7095 | doc: /* Send PROCESS the signal with code SIGCODE. | ||
| 7096 | PROCESS may also be a number specifying the process id of the | ||
| 7097 | process to signal; in this case, the process need not be a child of | ||
| 7098 | this Emacs. | ||
| 7099 | If PROCESS is a process object which contains the property | ||
| 7100 | `remote-pid', or PROCESS is a number and REMOTE is a remote file name, | ||
| 7101 | PROCESS is interpreted as process on the respective remote host, which | ||
| 7102 | will be the process to signal. | ||
| 7103 | SIGCODE may be an integer, or a symbol whose name is a signal name. */) | ||
| 7104 | (Lisp_Object process, Lisp_Object sigcode, Lisp_Object remote) | ||
| 7105 | { | ||
| 7106 | return CALLN (Frun_hook_with_args_until_success, Qsignal_process_functions, | ||
| 7107 | process, sigcode, remote); | ||
| 7108 | } | ||
| 7109 | |||
| 7094 | DEFUN ("process-send-eof", Fprocess_send_eof, Sprocess_send_eof, 0, 1, 0, | 7110 | DEFUN ("process-send-eof", Fprocess_send_eof, Sprocess_send_eof, 0, 1, 0, |
| 7095 | doc: /* Make PROCESS see end-of-file in its input. | 7111 | doc: /* Make PROCESS see end-of-file in its input. |
| 7096 | EOF comes after any text already sent to it. | 7112 | EOF comes after any text already sent to it. |
| @@ -8580,6 +8596,13 @@ These functions are called in the order of the list, until one of them | |||
| 8580 | returns non-nil. */); | 8596 | returns non-nil. */); |
| 8581 | Vinterrupt_process_functions = list1 (Qinternal_default_interrupt_process); | 8597 | Vinterrupt_process_functions = list1 (Qinternal_default_interrupt_process); |
| 8582 | 8598 | ||
| 8599 | DEFVAR_LISP ("signal-process-functions", Vsignal_process_functions, | ||
| 8600 | doc: /* List of functions to be called for `signal-process'. | ||
| 8601 | The arguments of the functions are the same as for `signal-process'. | ||
| 8602 | These functions are called in the order of the list, until one of them | ||
| 8603 | returns non-nil. */); | ||
| 8604 | Vsignal_process_functions = list1 (Qinternal_default_signal_process); | ||
| 8605 | |||
| 8583 | DEFVAR_LISP ("internal--daemon-sockname", Vinternal__daemon_sockname, | 8606 | DEFVAR_LISP ("internal--daemon-sockname", Vinternal__daemon_sockname, |
| 8584 | doc: /* Name of external socket passed to Emacs, or nil if none. */); | 8607 | doc: /* Name of external socket passed to Emacs, or nil if none. */); |
| 8585 | Vinternal__daemon_sockname = Qnil; | 8608 | Vinternal__daemon_sockname = Qnil; |
| @@ -8600,6 +8623,10 @@ sentinel or a process filter function has an error. */); | |||
| 8600 | "internal-default-interrupt-process"); | 8623 | "internal-default-interrupt-process"); |
| 8601 | DEFSYM (Qinterrupt_process_functions, "interrupt-process-functions"); | 8624 | DEFSYM (Qinterrupt_process_functions, "interrupt-process-functions"); |
| 8602 | 8625 | ||
| 8626 | DEFSYM (Qinternal_default_signal_process, | ||
| 8627 | "internal-default-signal-process"); | ||
| 8628 | DEFSYM (Qsignal_process_functions, "signal-process-functions"); | ||
| 8629 | |||
| 8603 | DEFSYM (Qnull, "null"); | 8630 | DEFSYM (Qnull, "null"); |
| 8604 | DEFSYM (Qpipe_process_p, "pipe-process-p"); | 8631 | DEFSYM (Qpipe_process_p, "pipe-process-p"); |
| 8605 | 8632 | ||
| @@ -8654,6 +8681,7 @@ sentinel or a process filter function has an error. */); | |||
| 8654 | defsubr (&Scontinue_process); | 8681 | defsubr (&Scontinue_process); |
| 8655 | defsubr (&Sprocess_running_child_p); | 8682 | defsubr (&Sprocess_running_child_p); |
| 8656 | defsubr (&Sprocess_send_eof); | 8683 | defsubr (&Sprocess_send_eof); |
| 8684 | defsubr (&Sinternal_default_signal_process); | ||
| 8657 | defsubr (&Ssignal_process); | 8685 | defsubr (&Ssignal_process); |
| 8658 | defsubr (&Swaiting_for_user_input_p); | 8686 | defsubr (&Swaiting_for_user_input_p); |
| 8659 | defsubr (&Sprocess_type); | 8687 | defsubr (&Sprocess_type); |