Re: tramp (2.7.0-pre master/463cd87f0590970cfd2918ba7028304e0f712001); tramp-signal-process doesn't accept string arguments

Michael Albinus <[email protected]>
Newsgroups gmane.emacs.tramp
Message-ID <[email protected]>
Philipp Stephani <[email protected]> writes:

Hi Philipp,

> Almost, but one case is still missing.  Try:
>
> emacs -Q -batch -eval '(progn (require (quote tramp)) (let ((proc (start-process "sleep" nil "sleep" "60"))) (signal-process (number-to-string (process-id proc)) (quote ABRT))))'
>
> This will fail even with the patch.
> `signal-process' accepts a process ID converted to a string.  This doesn't seem to be documented, but is necessary for interactive use because `signal-process' uses `read-string' to read its first argument interactively.

Yes. What about the modified patch?

Best regards, Michael.
(unnamed) (text/x-patch, 663 B)
diff --git a/lisp/tramp.el b/lisp/tramp.el
index 8a5c9617..5b1a4f84 100644
--- a/lisp/tramp.el
+++ b/lisp/tramp.el
@@ -6729,6 +6729,11 @@ If PROCESS is a process object which contains the property
 PROCESS is interpreted as process on the respective remote host, which
 will be the process to signal.
 SIGCODE may be an integer, or a symbol whose name is a signal name."
+  (when (stringp process)
+    (setq process (or (get-process process)
+		      (and (string-match-p (rx bol (+ digit) eol) process)
+			   (string-to-number process))
+		      (signal 'wrong-type-argument (list #'processp process)))))
   (let (pid vec)
     (cond
      ((processp process)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.