[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master 3431e82: Ignore directory symlinks in directory
Lars Magne Ingebrigtsen
Re: [Emacs-diffs] master 3431e82: Ignore directory symlinks in directory-files-recursively
Sat, 13 Dec 2014 16:01:07 +0100
Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)
Stefan Monnier <address@hidden> writes:
>> Ignore directory symlinks in directory-files-recursively
> Could you work on merging file-tree-walk and
As you pointed out, `file-tree-walk' has the nice property that it can
stop recursing based on a predicate, so implementing it on
`directory-files-recursively' would not be optimal.
On the other hand, the interface for `file-tree-walk' is not what people
usually want -- they just want a list of matching files. I grepped for
"defun.*recurs" and there's a lot of functions basically implementing
`directory-files-recursively'. Here are the first four:
Doing it the other way around would almost be possible, but
`directory-files-recursively' guarantees that leaves are returned before
directories so that implementing "rm -r" is just a `mapc' over the
returned values. And `file-tree-walk' doesn't call the callback
function in that order, so it's fiddly.
Besides, we don't have copyright paperwork for `file-tree-walk'.
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no