>From 513c690babd5dbc18366ded1ad5f8238fa798a28 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 27 May 2011 22:59:52 +0200 Subject: [PATCH 5/6] Support host names. --- tramp-adb.el | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tramp-adb.el b/tramp-adb.el index 1540f55..fd7dba2 100644 --- a/tramp-adb.el +++ b/tramp-adb.el @@ -105,7 +105,13 @@ "Invoke the ADB handler for OPERATION. First arg specifies the OPERATION, second arg is a list of arguments to pass to the OPERATION." - (let ((fn (assoc operation tramp-adb-file-name-handler-alist))) + (let ((fn (assoc operation tramp-adb-file-name-handler-alist)) + ;; `tramp-default-host's default value is (system-name). Not + ;; useful for us. + (tramp-default-host + (unless (equal (eval (car (get 'tramp-default-host 'standard-value))) + tramp-default-host) + tramp-default-host))) (if fn (save-match-data (apply (cdr fn) args)) (tramp-run-real-handler operation args)))) @@ -546,13 +552,16 @@ connection if a previous connection has died for some reason." (with-progress-reporter vec 3 "Opening adb shell connection" (let* ((coding-system-for-read 'utf-8-dos) ;is this correct? (process-connection-type tramp-process-connection-type) + (args (if (tramp-file-name-host vec) + (list "-s" (tramp-file-name-host vec) "shell") + (list "shell"))) (p (let ((default-directory (tramp-compat-temporary-file-directory))) - (start-process (tramp-buffer-name vec) buf - (tramp-adb-program) "shell")))) + (apply 'start-process (tramp-buffer-name vec) buf + (tramp-adb-program) args)))) (tramp-message vec 6 "%s" (mapconcat 'identity (process-command p) " ")) - ;; wait for initial prompty + ;; Wait for initial prompt. (tramp-wait-for-regexp p nil "^[#\\$][[:space:]]+") (unless (eq 'run (process-status p)) (tramp-error vec 'file-error "Terminated!")) -- 1.7.4.1