Function: ido-file-name-all-completions-1

ido-file-name-all-completions-1 is a byte-compiled function defined in ido.el.gz.

Signature

(ido-file-name-all-completions-1 DIR)

Source Code

;; Defined in /usr/src/emacs/lisp/ido.el.gz
(defun ido-file-name-all-completions-1 (dir)
  (cond
   ((ido-nonreadable-directory-p dir) '())
   ;; do not check (ido-directory-too-big-p dir) here.
   ;; Caller must have done that if necessary.

   ((and ido-enable-tramp-completion
	 (string-match "\\`/[^/]+[:@]\\'" dir))
    ;; Strip method:user@host: part of tramp completions.
    ;; Tramp completions do not include leading slash.
    (let* ((len (1- (length dir)))
	   (compl
	    (or ;; We do not want to be disturbed by "File does not
                ;; exist" errors.
                (ignore-errors (file-name-all-completions "" dir))
		;; work around bug in ange-ftp.
		;; /ftp:user@host: => nil
		;; /ftp:user@host:./ => ok
		(and
		 (not (string= "/ftp:" dir))
		 (file-remote-p dir)
		 ;; tramp-ftp-file-name-p is available only when tramp
		 ;; has been loaded.
		 (fboundp 'tramp-ftp-file-name-p)
		 (tramp-ftp-file-name-p dir)
		 (string-match ":\\'" dir)
		 (file-name-all-completions "" (concat dir "./"))))))
      (if (and compl
	       (> (length (car compl)) len)
	       (string= (substring (car compl) 0 len) (substring dir 1)))
	  (mapcar (lambda (c) (substring c len)) compl)
	compl)))
   (t
    (file-name-all-completions "" dir))))