]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Bug#33135
authorMichael Albinus <michael.albinus@gmx.de>
Mon, 5 Nov 2018 13:31:07 +0000 (14:31 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Mon, 5 Nov 2018 13:31:07 +0000 (14:31 +0100)
* lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler): Support threads.
(Bug#33135)

lisp/net/tramp-ftp.el

index 983f168ddb45f1a5e5719d92799529b624380fac..b1650f0c5ac017385dfe391bbdee16d0745b945f 100644 (file)
@@ -131,7 +131,16 @@ pass to the OPERATION."
          ;; "ftp" method is used in the Tramp file name. So we unset
          ;; those values.
          (ange-ftp-ftp-name-arg "")
-         (ange-ftp-ftp-name-res nil))
+         (ange-ftp-ftp-name-res nil)
+         (v (tramp-dissect-file-name
+             (apply 'tramp-file-name-for-operation operation args) t)))
+      (setf (tramp-file-name-method v) tramp-ftp-method)
+      ;; Set "process-name" for thread support.
+      (tramp-set-connection-property
+       v "process-name"
+       (ange-ftp-ftp-process-buffer
+       (tramp-file-name-host v) (tramp-file-name-user v)))
+
       (cond
        ;; If argument is a symlink, `file-directory-p' and
        ;; `file-exists-p' call the traversed file recursively. So we
@@ -143,9 +152,7 @@ pass to the OPERATION."
        ;; "~/.netrc".
        ((memq operation '(file-directory-p file-exists-p))
        (if (apply 'ange-ftp-hook-function operation args)
-           (let ((v (tramp-dissect-file-name (car args) t)))
-             (setf (tramp-file-name-method v) tramp-ftp-method)
-             (tramp-set-connection-property v "started" t))
+           (tramp-set-connection-property v "started" t)
          nil))
 
        ;; If the second argument of `copy-file' or `rename-file' is a