[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master 3431e82: Ignore directory symlinks in directory
Re: [Emacs-diffs] master 3431e82: Ignore directory symlinks in directory-files-recursively
Sun, 21 Dec 2014 12:57:44 +0100
Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)
Stefan Monnier <address@hidden> writes:
>> And I don't like passing in the DIR and LEAF separately.
> It can avoid calling expand-file-name only to call file-name-directory
> (or file-name-nondirectory) right after.
It can, but in the use cases I've typically seen, you wouldn't do that,
I think? You'd say `(directory-name-p file)' and then... something...
>> -(defun directory-files-recursively (dir match &optional include-directories)
>> +(defun directory-files-recursively (dir match &optional
>> + include-directories predicate)
> Can we reduce the number of arguments?
That would be nice, but I'm not sure what to remove. The canonical,
that most of the callers use (from the other versions of this function
included in various packages in Emacs) is
(directory-files-recursively "~/" "~\\'")
or something. And then there are a couple that want the directories,
too. And then there's `file-tree-walk', which is the new thing.
Uhm... we could make MATCH be the predicate if it's not a string?
>> (path (expand-file-name leaf dir)))
> This is not a "path", it's a file name. Remember: by convention
> a "path" is a list of directories, as in load-path, $PATH, etc...
Right. But do we have a word for "string that designates either a file
or a directory"? That's usually called "a path"...
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/