Function: tramp-adb-handle-file-name-all-completions

tramp-adb-handle-file-name-all-completions is a byte-compiled function defined in tramp-adb.el.gz.

Signature

(tramp-adb-handle-file-name-all-completions FILENAME DIRECTORY)

Documentation

Like file-name-all-completions for Tramp files.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-adb.el.gz
(defun tramp-adb-handle-file-name-all-completions (filename directory)
  "Like `file-name-all-completions' for Tramp files."
  (tramp-skeleton-file-name-all-completions filename directory
    (all-completions
     filename
     (with-parsed-tramp-file-name (expand-file-name directory) nil
       (with-tramp-file-property v localname "file-name-all-completions"
	 (unless (tramp-adb-send-command-and-check
		  v (format "(%s -a %s; echo tramp_exit_status $?) | cat"
			    (tramp-adb-get-ls-command v)
			    (tramp-shell-quote-argument localname))
                  nil t)
	   (erase-buffer))
	 (mapcar
	  (lambda (f)
	    (if (file-directory-p (expand-file-name f directory))
		(file-name-as-directory f)
	      f))
	  (with-current-buffer (tramp-get-buffer v)
	    (mapcar
	     (lambda (l)
	       (and (not (string-match-p (rx bol (* blank) eol) l)) l))
	     (split-string (buffer-string) "\n" 'omit)))))))))