tramp (2.8.3-pre nil/nil); fix tramp-file-name-for-operation when process is given as a string

Alexey Lebedev <[email protected]>
Newsgroups gmane.emacs.tramp
Message-ID <[email protected]>
Hi,

This is an addition to a recent commit "Extend integration of external operations in Tramp" /
00b767089e711bdbd5d2e470d66fa17390da73f0

When process was passed as a string to (tramp-file-name-for-operation),
this caused (tramp-get-default-directory) to fail, as it was expecting a
buffer.


Best,
Alexey Lebedev
tramp-process-as-string.patch (text/x-patch, 594 B)
diff --git i/lisp/net/tramp.el w/lisp/net/tramp.el
index cb89428886e..52c73dcf92a 100644
--- i/lisp/net/tramp.el
+++ w/lisp/net/tramp.el
@@ -2573,7 +2573,9 @@ Must be handled by the callers."
 		   ((bufferp (nth 0 args)) (get-buffer (nth 0 args)))
 		   ((stringp (nth 0 args))
 		    ;; Process or buffer name.
-		    (or (get-process (nth 0 args)) (get-buffer (nth 0 args)))))))
+		    (or (when-let* ((proc (get-process (nth 0 args))))
+                          (process-buffer proc))
+                        (get-buffer (nth 0 args)))))))
 	  (tramp-get-default-directory buf))
 	""))
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.