Function: speedbar-file-lists
speedbar-file-lists is a byte-compiled function defined in
speedbar.el.gz.
Signature
(speedbar-file-lists DIRECTORY)
Documentation
Create file lists for DIRECTORY.
The car is the list of directories, the cdr is list of files not
matching ignored headers. Cache any directory files found in
speedbar-directory-contents-alist and use that cache before scanning
the file-system.
Source Code
;; Defined in /usr/src/emacs/lisp/speedbar.el.gz
;;; File button management
;;
(defun speedbar-file-lists (directory)
"Create file lists for DIRECTORY.
The car is the list of directories, the cdr is list of files not
matching ignored headers. Cache any directory files found in
`speedbar-directory-contents-alist' and use that cache before scanning
the file-system."
(setq directory (expand-file-name directory))
;; find the directory, either in the cache, or build it.
(or (and (not dframe-power-click) ;; In powerclick mode, always rescan.
(cdr-safe (assoc directory speedbar-directory-contents-alist)))
(let ((default-directory directory)
(dir (directory-files directory nil))
(dirs nil)
(files nil))
(while dir
(if (not
(or (string-match speedbar-file-unshown-regexp (car dir))
(member (car dir) vc-directory-exclusion-list)
(string-match speedbar-directory-unshown-regexp (car dir))))
(if (file-directory-p (car dir))
(setq dirs (cons (car dir) dirs))
(setq files (cons (car dir) files))))
(setq dir (cdr dir)))
(let ((nl (cons (nreverse dirs) (list (nreverse files))))
(ae (assoc directory speedbar-directory-contents-alist)))
(if ae (setcdr ae nl)
(push (cons directory nl)
speedbar-directory-contents-alist))
nl))
))