From b0be4e33627bc94d1fb80b61e7013f3cf3b981b1 Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Sun, 14 Jul 2024 15:07:28 -0700 Subject: [PATCH] Support passing signals like 'SIGCODE' to 'tramp-signal-process' POSIX specifies that "kill" should take signal names without the "SIG" prefix. * lisp/net/tramp.el (tramp-signal-process): Strip the "SIG" prefix when present. --- lisp/net/tramp.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index e8329c82743..16ba4dc8e1c 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -6986,8 +6986,13 @@ tramp-signal-process (setq pid process vec (and (stringp remote) (tramp-dissect-file-name remote)))) (t (signal 'wrong-type-argument (list #'processp process)))) - (unless (or (numberp sigcode) (symbolp sigcode)) - (signal 'wrong-type-argument (list #'numberp sigcode))) + (cond + ((symbolp sigcode) + (setq sigcode (symbol-name sigcode)) + (when (string-prefix-p "SIG" sigcode) + (setq sigcode (substring sigcode 3)))) + ((not (numberp sigcode)) + (signal 'wrong-type-argument (list #'numberp sigcode)))) ;; If it's a Tramp process, send SIGCODE remotely. (when (and pid vec) (tramp-message -- 2.25.1