]> code.delx.au - gnu-emacs/blobdiff - lisp/net/tramp-adb.el
Merge from origin/emacs-25
[gnu-emacs] / lisp / net / tramp-adb.el
index 5940b713958a5d5585d09e988e5e9fd5ec94afc2..f77e44e79cea32355051ab9e9f1004f0e59f04d6 100644 (file)
@@ -535,7 +535,7 @@ Emacs dired can't find files."
   "Like `file-name-all-completions' for Tramp files."
   (all-completions
    filename
-   (with-parsed-tramp-file-name directory nil
+   (with-parsed-tramp-file-name (expand-file-name directory) nil
      (with-tramp-file-property v localname "file-name-all-completions"
        (save-match-data
         (tramp-adb-send-command
@@ -934,20 +934,22 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
     (unless (stringp program)
       (tramp-error v 'file-error "PROGRAM must be a string"))
 
-    (let ((command
-          (format "cd %s; %s"
-                  (tramp-shell-quote-argument localname)
-                  (mapconcat 'tramp-shell-quote-argument
-                             (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))
-
-      (unless buffer
-       ;; BUFFER can be nil.  We use a temporary buffer.
-       (setq buffer (generate-new-buffer tramp-temp-buffer-name)))
+    (let* ((buffer
+           (if buffer
+               (get-buffer-create buffer)
+             ;; BUFFER can be nil.  We use a temporary buffer.
+             (generate-new-buffer tramp-temp-buffer-name)))
+          (command
+           (format "cd %s; %s"
+                   (tramp-shell-quote-argument localname)
+                   (mapconcat 'tramp-shell-quote-argument
+                              (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))
+
       (while (get-process name1)
        ;; NAME must be unique as process name.
        (setq i (1+ i)
@@ -1043,7 +1045,7 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\"
   "Returns nil on success error-output on failure."
   (when (and (> (length (tramp-file-name-host vec)) 0)
             ;; The -s switch is only available for ADB device commands.
-            (not (member (car args) (list "connect" "disconnect"))))
+            (not (member (car args) '("connect" "disconnect"))))
     (setq args (append (list "-s" (tramp-adb-get-device vec)) args)))
   (with-temp-buffer
     (prog1