[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master 11cf3e9: Implement a new function directory-fil
From: |
Stefan Monnier |
Subject: |
Re: [Emacs-diffs] master 11cf3e9: Implement a new function directory-files-recursively |
Date: |
Tue, 09 Dec 2014 19:42:58 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Hello people?
Maybe Eric is not following Emacs development very closely, but he's not
a complete idiot either. So if you think he got his function wrong,
I think it's a bit presumptuous to think you can be sure your version
will be "the right one" without even discussing it on emacs-devel.
> +(defun directory-files-recursively (dir match &optional include-directories)
> + "Return all files under DIR that have file names matching MATCH (a regexp).
> +This function works recursively. Files are returned in \"depth first\"
> +and alphabetical order.
> +If INCLUDE-DIRECTORIES, also include directories that have matching names."
Eric's version allows precise control those subdirectories in which we
want to recurse and those in which we don't. This is a very
important functionality.
> + (let ((result nil)
> + (files nil))
> + (dolist (file (directory-files dir t))
> + (let ((leaf (file-name-nondirectory file)))
> + (unless (member leaf '("." ".."))
> + (if (file-directory-p file)
And here you make the same mistake that I already pointed out to Eric:
using directory-files followed by file-directory-p on each file is about
10 times slower than using file-name-all-completions and checking the
presence of a final / instead.
Stefan
- Re: [Emacs-diffs] master 11cf3e9: Implement a new function directory-files-recursively,
Stefan Monnier <=
- Re: [Emacs-diffs] master 11cf3e9: Implement a new function directory-files-recursively, Lars Magne Ingebrigtsen, 2014/12/09
- Re: [Emacs-diffs] master 11cf3e9: Implement a new function directory-files-recursively, Lars Magne Ingebrigtsen, 2014/12/10
- Re: [Emacs-diffs] master 11cf3e9: Implement a new function directory-files-recursively, Lars Magne Ingebrigtsen, 2014/12/10
- Re: [Emacs-diffs] master 11cf3e9: Implement a new function directory-files-recursively, Stefan Monnier, 2014/12/10
- Re: [Emacs-diffs] master 11cf3e9: Implement a new function directory-files-recursively, Thierry Volpiatto, 2014/12/10
- Re: [Emacs-diffs] master 11cf3e9: Implement a new function directory-files-recursively, Lars Magne Ingebrigtsen, 2014/12/11
- Re: [Emacs-diffs] master 11cf3e9: Implement a new function directory-files-recursively, Stefan Monnier, 2014/12/11
- Re: [Emacs-diffs] master 11cf3e9: Implement a new function directory-files-recursively, Thierry Volpiatto, 2014/12/13
- Re: [Emacs-diffs] master 11cf3e9: Implement a new function directory-files-recursively, Lars Magne Ingebrigtsen, 2014/12/13
- Re: [Emacs-diffs] master 11cf3e9: Implement a new function directory-files-recursively, Thierry Volpiatto, 2014/12/13