diff options
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/net/tramp-adb.el | 48 |
2 files changed, 21 insertions, 33 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d439c661401..3700121e5fe 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-01-21 Jürgen Hötzel <juergen@archlinux.org> | ||
| 2 | |||
| 3 | * net/tramp-adb.el (tramp-adb-handle-start-file-process): Complete | ||
| 4 | reimplementation using "adb shell command ..." instead of running | ||
| 5 | remote shell interactively. | ||
| 6 | |||
| 1 | 2013-01-20 Glenn Morris <rgm@gnu.org> | 7 | 2013-01-20 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * emacs-lisp/lisp-mode.el (emacs-lisp-mode-map): | 9 | * emacs-lisp/lisp-mode.el (emacs-lisp-mode-map): |
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index ab13d4cf442..6b8d16afc80 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -907,15 +907,11 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 907 | (cons program args) " ")))) | 907 | (cons program args) " ")))) |
| 908 | (tramp-process-connection-type | 908 | (tramp-process-connection-type |
| 909 | (or (null program) tramp-process-connection-type)) | 909 | (or (null program) tramp-process-connection-type)) |
| 910 | (bmp (and (buffer-live-p buffer) (buffer-modified-p buffer))) | ||
| 911 | (name1 name) | 910 | (name1 name) |
| 912 | (i 0)) | 911 | (i 0)) |
| 913 | (unwind-protect | 912 | (unwind-protect |
| 914 | (save-excursion | 913 | (save-excursion |
| 915 | (save-restriction | 914 | (save-restriction |
| 916 | (unless buffer | ||
| 917 | ;; BUFFER can be nil. We use a temporary buffer. | ||
| 918 | (setq buffer (generate-new-buffer tramp-temp-buffer-name))) | ||
| 919 | (while (get-process name1) | 915 | (while (get-process name1) |
| 920 | ;; NAME must be unique as process name. | 916 | ;; NAME must be unique as process name. |
| 921 | (setq i (1+ i) | 917 | (setq i (1+ i) |
| @@ -923,35 +919,21 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 923 | (setq name name1) | 919 | (setq name name1) |
| 924 | ;; Set the new process properties. | 920 | ;; Set the new process properties. |
| 925 | (tramp-set-connection-property v "process-name" name) | 921 | (tramp-set-connection-property v "process-name" name) |
| 926 | (tramp-set-connection-property v "process-buffer" buffer) | 922 | (when command |
| 927 | ;; Activate narrowing in order to save BUFFER contents. | 923 | (let* ((host (tramp-file-name-host v)) |
| 928 | ;; Clear also the modification time; otherwise we might | 924 | (devices (mapcar 'cadr (tramp-adb-parse-device-names nil))) |
| 929 | ;; be interrupted by `verify-visited-file-modtime'. | 925 | (args (if (> (length host) 0) |
| 930 | (with-current-buffer (tramp-get-connection-buffer v) | 926 | (list "-s" host "shell" command) |
| 931 | (let ((buffer-undo-list t)) | 927 | (list "shell" command))) |
| 932 | (clear-visited-file-modtime) | 928 | (p (apply 'start-process (tramp-get-connection-name v) buffer |
| 933 | (narrow-to-region (point-max) (point-max)) | 929 | (tramp-adb-program) args))) |
| 934 | (if command | 930 | ;; Set sentinel and query flag for this process. |
| 935 | ;; Send the command. | 931 | (tramp-set-connection-property p "vector" v) |
| 936 | (tramp-adb-send-command v command) | 932 | (set-process-sentinel p 'tramp-process-sentinel) |
| 937 | ;; Open the connection. | 933 | (tramp-compat-set-process-query-on-exit-flag p t) |
| 938 | (tramp-adb-maybe-open-connection v)))) | 934 | ;; Return process. |
| 939 | (let ((p (tramp-get-connection-process v))) | 935 | p)))) |
| 940 | ;; Set sentinel and query flag for this process. | 936 | (tramp-set-connection-property v "process-name" nil))))) |
| 941 | (tramp-set-connection-property p "vector" v) | ||
| 942 | (set-process-sentinel p 'tramp-process-sentinel) | ||
| 943 | (tramp-compat-set-process-query-on-exit-flag p t) | ||
| 944 | ;; Return process. | ||
| 945 | p))) | ||
| 946 | ;; Save exit. | ||
| 947 | (with-current-buffer (tramp-get-connection-buffer v) | ||
| 948 | (if (string-match tramp-temp-buffer-name (buffer-name)) | ||
| 949 | (progn | ||
| 950 | (set-process-buffer (tramp-get-connection-process v) nil) | ||
| 951 | (kill-buffer (current-buffer))) | ||
| 952 | (set-buffer-modified-p bmp))) | ||
| 953 | (tramp-set-connection-property v "process-name" nil) | ||
| 954 | (tramp-set-connection-property v "process-buffer" nil))))) | ||
| 955 | 937 | ||
| 956 | ;; Helper functions. | 938 | ;; Helper functions. |
| 957 | 939 | ||