Support passing signals like 'SIGCODE' to 'tramp-signal-process'
authorJim Porter <jporterbugs@gmail.com>
Sun, 14 Jul 2024 22:07:28 +0000 (15:07 -0700)
committerJim Porter <jporterbugs@gmail.com>
Mon, 15 Jul 2024 16:34:43 +0000 (09:34 -0700)
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

index e8329c827435d972d72ffb215c7bc55ba949d627..5c7236011b8f0bdbec8f087e5b99a4f380357b8d 100644 (file)
@@ -6986,8 +6986,13 @@ SIGCODE may be an integer, or a symbol whose name is a signal name."
       (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 (upcase (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