Function: ido-make-file-list

ido-make-file-list is a byte-compiled function defined in ido.el.gz.

Signature

(ido-make-file-list DEFAULT)

Documentation

Return the current list of files.

Currently visible files are put at the end of the list. The hook ido-make-file-list-hook is run after the list has been created to allow the user to further modify the order of the file names in this list.

Source Code

;; Defined in /usr/src/emacs/lisp/ido.el.gz
(defun ido-make-file-list (default)
  "Return the current list of files.
Currently visible files are put at the end of the list.
The hook `ido-make-file-list-hook' is run after the list has been
created to allow the user to further modify the order of the file names
in this list."
  (let ((ido-temp-list (ido-make-file-list-1 ido-current-directory)))
    (setq ido-temp-list (sort ido-temp-list
			      (if ido-file-extensions-order
				  #'ido-file-extension-lessp
				#'ido-file-lessp)))
    (unless (ido-is-tramp-root ido-current-directory)
      (let ((default-directory ido-current-directory))
	(ido-to-end ;; move ftp hosts and visited files to end
	 (delq nil (mapcar
		    (lambda (x) (if (or (and (string-match ".:\\'" x)
					     (not (ido-local-file-exists-p x)))
					(and (not (ido-final-slash x))
					     (let (file-name-handler-alist)
					       (get-file-buffer x))))
			       x))
		    ido-temp-list)))))
    (ido-to-end  ;; move . files to end
     (delq nil (mapcar
		(lambda (x) (if (string-match "\\`\\." x) x))
		ido-temp-list)))
    (if (and default (member default ido-temp-list))
	(if (or ido-rotate-temp ido-rotate-file-list-default)
	    (unless (equal default (car ido-temp-list))
	      (let ((l ido-temp-list) k)
		(while (and l (cdr l) (not (equal default (car (cdr l)))))
		  (setq l (cdr l)))
		(setq k (cdr l))
		(setcdr l nil)
		(nconc k ido-temp-list)
		(setq ido-temp-list k)))
	  (setq ido-temp-list
		(delete default ido-temp-list))
	  (setq ido-temp-list
		(cons default ido-temp-list))))
    (when ido-show-dot-for-dired
      (setq ido-temp-list (delete "." ido-temp-list))
      (setq ido-temp-list (cons "." ido-temp-list)))
    (run-hooks 'ido-make-file-list-hook)
    ido-temp-list))