Each file name appears in the returned list in its absolute form.
Optional argument INCLUDE-DIRECTORIES non-nil means also include in the
output directories whose names match REGEXP."
- (let ((result nil)
- (files nil)
- ;; When DIR is "/", remote file names like "/method:" could
- ;; also be offered. We shall suppress them.
- (tramp-mode (and tramp-mode (file-remote-p (expand-file-name dir)))))
+ (let* ((result nil)
+ (files nil)
+ (dir (directory-file-name dir))
+ ;; When DIR is "/", remote file names like "/method:" could
+ ;; also be offered. We shall suppress them.
+ (tramp-mode (and tramp-mode (file-remote-p (expand-file-name dir)))))
(dolist (file (sort (file-name-all-completions "" dir)
'string<))
(unless (member file '("./" "../"))
(if (directory-name-p file)
(let* ((leaf (substring file 0 (1- (length file))))
- (full-file (expand-file-name leaf dir)))
+ (full-file (concat dir "/" leaf)))
;; Don't follow symlinks to other directories.
(unless (file-symlink-p full-file)
(setq result
(string-match regexp leaf))
(setq result (nconc result (list full-file)))))
(when (string-match regexp file)
- (push (expand-file-name file dir) files)))))
+ (push (concat dir "/" file) files)))))
(nconc result (nreverse files))))
(defvar module-file-suffix)