Function: ange-ftp-file-name-all-completions

ange-ftp-file-name-all-completions is a byte-compiled function defined in ange-ftp.el.gz.

Signature

(ange-ftp-file-name-all-completions FILE DIR)

Source Code

;; Defined in /usr/src/emacs/lisp/net/ange-ftp.el.gz
(defun ange-ftp-file-name-all-completions (file dir)
  (let ((ange-ftp-this-dir (expand-file-name dir)))
    (if (ange-ftp-ftp-name ange-ftp-this-dir)
	(ange-ftp-ignore-errors-if-non-essential
	  (ange-ftp-barf-if-not-directory ange-ftp-this-dir)
	  (setq ange-ftp-this-dir
		(ange-ftp-real-file-name-as-directory ange-ftp-this-dir))
	  (let* ((tbl (ange-ftp-get-files ange-ftp-this-dir))
		 (completions (all-completions file tbl)))

	    ;; see whether each matching file is a directory or not...
	    (mapcar
             (lambda (file)
               (let ((ent (gethash file tbl)))
                 (if (and ent
                          (or (not (stringp ent))
                              (file-directory-p
                               (ange-ftp-expand-symlink ent
                                                        ange-ftp-this-dir))))
                     (concat file "/")
		   file)))
	     completions)))

      (if (ange-ftp-root-dir-p ange-ftp-this-dir)
	  (nconc (all-completions file (ange-ftp-generate-root-prefixes))
		 (ange-ftp-real-file-name-all-completions file
							  ange-ftp-this-dir))
	(ange-ftp-real-file-name-all-completions file ange-ftp-this-dir)))))