Function: ido-make-dir-list

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

Signature

(ido-make-dir-list DEFAULT)

Documentation

Return the current list of directories.

The hook ido-make-dir-list-hook is run after the list has been created to allow the user to further modify the order of the directory names in this list.

Source Code

;; Defined in /usr/src/emacs/lisp/ido.el.gz
(defun ido-make-dir-list (default)
  "Return the current list of directories.
The hook `ido-make-dir-list-hook' is run after the list has been
created to allow the user to further modify the order of the
directory names in this list."
  (let ((ido-temp-list (ido-make-dir-list-1 ido-current-directory)))
    (setq ido-temp-list (sort ido-temp-list #'ido-file-lessp))
    (ido-to-end  ;; move . files to end
     (delq nil (mapcar
		(lambda (x) (if (string-equal (substring x 0 1) ".") 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))))
    (setq ido-temp-list (delete "." ido-temp-list))
    (unless ido-input-stack
      (setq ido-temp-list (cons "." ido-temp-list)))
    (run-hooks 'ido-make-dir-list-hook)
    ido-temp-list))