diff options
| author | Michael Albinus | 2013-02-28 20:33:03 +0100 |
|---|---|---|
| committer | Michael Albinus | 2013-02-28 20:33:03 +0100 |
| commit | 779451da533b042d2c84132e6157f49b38ede475 (patch) | |
| tree | eb5059871844428812506315d11aa00aa79f3297 | |
| parent | 538d9b943995f0767ff86354b962b36b0b4a5f1f (diff) | |
| download | emacs-779451da533b042d2c84132e6157f49b38ede475.tar.gz emacs-779451da533b042d2c84132e6157f49b38ede475.zip | |
* net/tramp-adb.el (tramp-adb-sdk-dir): Remove. Replaced by ...
(tramp-adb-program): New defcustom. Remove function. Adapt calls.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/tramp-adb.el | 28 |
2 files changed, 17 insertions, 16 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 66b18651695..9721dba6b0f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-02-28 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp-adb.el (tramp-adb-sdk-dir): Remove. Replaced by ... | ||
| 4 | (tramp-adb-program): New defcustom. Remove function. Adapt calls. | ||
| 5 | |||
| 1 | 2013-02-28 Agustín Martín Domingo <agustin.martin@hispalinux.es> | 6 | 2013-02-28 Agustín Martín Domingo <agustin.martin@hispalinux.es> |
| 2 | 7 | ||
| 3 | Initial support for hunspell dictionaries auto-detection (Bug#13639) | 8 | Initial support for hunspell dictionaries auto-detection (Bug#13639) |
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 809623280bc..766dcdbbe6a 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -23,10 +23,11 @@ | |||
| 23 | 23 | ||
| 24 | ;;; Commentary: | 24 | ;;; Commentary: |
| 25 | 25 | ||
| 26 | ;; The Android Debug Bridge must be installed on your local machine. | 26 | ;; The Android Debug Bridge "adb" must be installed on your local |
| 27 | ;; Add the following form into your .emacs: | 27 | ;; machine. If it is not in your $PATH, add the following form into |
| 28 | ;; your .emacs: | ||
| 28 | ;; | 29 | ;; |
| 29 | ;; (setq tramp-adb-sdk-dir "/path/to/android/sdk") | 30 | ;; (setq tramp-adb-program "/path/to/adb") |
| 30 | ;; | 31 | ;; |
| 31 | ;; Due to security it is not possible to access non-root devices. | 32 | ;; Due to security it is not possible to access non-root devices. |
| 32 | 33 | ||
| @@ -37,11 +38,11 @@ | |||
| 37 | 38 | ||
| 38 | (defvar dired-move-to-filename-regexp) | 39 | (defvar dired-move-to-filename-regexp) |
| 39 | 40 | ||
| 40 | (defcustom tramp-adb-sdk-dir "~/Android/sdk" | 41 | (defcustom tramp-adb-program "adb" |
| 41 | "Set to the directory containing the Android SDK." | 42 | "Name of the Android Debug Bridge program." |
| 42 | :type 'string | 43 | :group 'tramp |
| 43 | :version "24.4" | 44 | :version "24.4" |
| 44 | :group 'tramp) | 45 | :type 'string) |
| 45 | 46 | ||
| 46 | ;;;###tramp-autoload | 47 | ;;;###tramp-autoload |
| 47 | (defconst tramp-adb-method "adb" | 48 | (defconst tramp-adb-method "adb" |
| @@ -149,17 +150,12 @@ pass to the OPERATION." | |||
| 149 | (save-match-data (apply (cdr fn) args)) | 150 | (save-match-data (apply (cdr fn) args)) |
| 150 | (tramp-run-real-handler operation args)))) | 151 | (tramp-run-real-handler operation args)))) |
| 151 | 152 | ||
| 152 | ;; This cannot be a constant, because `tramp-adb-sdk-dir' is customizable. | ||
| 153 | (defun tramp-adb-program () | ||
| 154 | "The Android Debug Bridge." | ||
| 155 | (expand-file-name "platform-tools/adb" tramp-adb-sdk-dir)) | ||
| 156 | |||
| 157 | ;;;###tramp-autoload | 153 | ;;;###tramp-autoload |
| 158 | (defun tramp-adb-parse-device-names (ignore) | 154 | (defun tramp-adb-parse-device-names (ignore) |
| 159 | "Return a list of (nil host) tuples allowed to access." | 155 | "Return a list of (nil host) tuples allowed to access." |
| 160 | (with-timeout (10) | 156 | (with-timeout (10) |
| 161 | (with-temp-buffer | 157 | (with-temp-buffer |
| 162 | (when (zerop (call-process (tramp-adb-program) nil t nil "devices")) | 158 | (when (zerop (call-process tramp-adb-program nil t nil "devices")) |
| 163 | (let (result) | 159 | (let (result) |
| 164 | (goto-char (point-min)) | 160 | (goto-char (point-min)) |
| 165 | (while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t) | 161 | (while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t) |
| @@ -982,11 +978,11 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 982 | (setq args (append (list "-s" (tramp-file-name-host vec)) args))) | 978 | (setq args (append (list "-s" (tramp-file-name-host vec)) args))) |
| 983 | (with-temp-buffer | 979 | (with-temp-buffer |
| 984 | (prog1 | 980 | (prog1 |
| 985 | (unless (zerop (apply 'call-process (tramp-adb-program) nil t nil args)) | 981 | (unless (zerop (apply 'call-process tramp-adb-program nil t nil args)) |
| 986 | (buffer-string)) | 982 | (buffer-string)) |
| 987 | (tramp-message | 983 | (tramp-message |
| 988 | vec 6 "%s %s\n%s" | 984 | vec 6 "%s %s\n%s" |
| 989 | (tramp-adb-program) (mapconcat 'identity args " ") (buffer-string))))) | 985 | tramp-adb-program (mapconcat 'identity args " ") (buffer-string))))) |
| 990 | 986 | ||
| 991 | (defun tramp-adb-find-test-command (vec) | 987 | (defun tramp-adb-find-test-command (vec) |
| 992 | "Checks, whether the ash has a builtin \"test\" command. | 988 | "Checks, whether the ash has a builtin \"test\" command. |
| @@ -1103,7 +1099,7 @@ connection if a previous connection has died for some reason." | |||
| 1103 | (p (let ((default-directory | 1099 | (p (let ((default-directory |
| 1104 | (tramp-compat-temporary-file-directory))) | 1100 | (tramp-compat-temporary-file-directory))) |
| 1105 | (apply 'start-process (tramp-get-connection-name vec) buf | 1101 | (apply 'start-process (tramp-get-connection-name vec) buf |
| 1106 | (tramp-adb-program) args)))) | 1102 | tramp-adb-program args)))) |
| 1107 | (tramp-message | 1103 | (tramp-message |
| 1108 | vec 6 "%s" (mapconcat 'identity (process-command p) " ")) | 1104 | vec 6 "%s" (mapconcat 'identity (process-command p) " ")) |
| 1109 | ;; Wait for initial prompt. | 1105 | ;; Wait for initial prompt. |