]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/tramp-adb.el (tramp-adb-handle-start-file-process): Complete
authorJürgen Hötzel <juergen@archlinux.org>
Mon, 21 Jan 2013 09:40:51 +0000 (10:40 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Mon, 21 Jan 2013 09:40:51 +0000 (10:40 +0100)
reimplementation using "adb shell command ..." instead of running
remote shell interactively.

lisp/ChangeLog
lisp/net/tramp-adb.el

index d439c661401ad401b9b736f81503444493d05a76..3700121e5fec2681d81f1ab0c9b673f916dca9a3 100644 (file)
@@ -1,3 +1,9 @@
+2013-01-21  Jürgen Hötzel  <juergen@archlinux.org>
+
+       * net/tramp-adb.el (tramp-adb-handle-start-file-process): Complete
+       reimplementation using "adb shell command ..." instead of running
+       remote shell interactively.
+
 2013-01-20  Glenn Morris  <rgm@gnu.org>
 
        * emacs-lisp/lisp-mode.el (emacs-lisp-mode-map):
index ab13d4cf44217053ddf307cdea1a58e126c5a385..6b8d16afc80d7d7cf5f39c6950eab88649db9dd0 100644 (file)
@@ -907,15 +907,11 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
                                (cons program args) " "))))
          (tramp-process-connection-type
           (or (null program) tramp-process-connection-type))
-         (bmp (and (buffer-live-p buffer) (buffer-modified-p buffer)))
          (name1 name)
          (i 0))
       (unwind-protect
          (save-excursion
            (save-restriction
-             (unless buffer
-               ;; BUFFER can be nil.  We use a temporary buffer.
-               (setq buffer (generate-new-buffer tramp-temp-buffer-name)))
              (while (get-process name1)
                ;; NAME must be unique as process name.
                (setq i (1+ i)
@@ -923,35 +919,21 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
              (setq name name1)
              ;; Set the new process properties.
              (tramp-set-connection-property v "process-name" name)
-             (tramp-set-connection-property v "process-buffer" buffer)
-             ;; Activate narrowing in order to save BUFFER contents.
-             ;; Clear also the modification time; otherwise we might
-             ;; be interrupted by `verify-visited-file-modtime'.
-             (with-current-buffer (tramp-get-connection-buffer v)
-               (let ((buffer-undo-list t))
-                 (clear-visited-file-modtime)
-                 (narrow-to-region (point-max) (point-max))
-                 (if command
-                     ;; Send the command.
-                     (tramp-adb-send-command v command)
-                   ;; Open the connection.
-                   (tramp-adb-maybe-open-connection v))))
-             (let ((p (tramp-get-connection-process v)))
-               ;; Set sentinel and query flag for this process.
-               (tramp-set-connection-property p "vector" v)
-               (set-process-sentinel p 'tramp-process-sentinel)
-               (tramp-compat-set-process-query-on-exit-flag p t)
-               ;; Return process.
-               p)))
-       ;; Save exit.
-       (with-current-buffer (tramp-get-connection-buffer v)
-         (if (string-match tramp-temp-buffer-name (buffer-name))
-             (progn
-               (set-process-buffer (tramp-get-connection-process v) nil)
-               (kill-buffer (current-buffer)))
-           (set-buffer-modified-p bmp)))
-       (tramp-set-connection-property v "process-name" nil)
-       (tramp-set-connection-property v "process-buffer" nil)))))
+             (when command
+               (let* ((host (tramp-file-name-host v))
+                      (devices (mapcar 'cadr (tramp-adb-parse-device-names nil)))
+                      (args (if (> (length host) 0)
+                                (list "-s" host "shell" command)
+                              (list "shell" command)))
+                      (p (apply 'start-process (tramp-get-connection-name v) buffer
+                                (tramp-adb-program) args)))
+                 ;; Set sentinel and query flag for this process.
+                 (tramp-set-connection-property p "vector" v)
+                 (set-process-sentinel p 'tramp-process-sentinel)
+                 (tramp-compat-set-process-query-on-exit-flag p t)
+                 ;; Return process.
+                 p))))
+       (tramp-set-connection-property v "process-name" nil)))))
 
 ;; Helper functions.