[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master e820f16: Added file-tree-walk to files.el.
From: |
David Engster |
Subject: |
Re: [Emacs-diffs] master e820f16: Added file-tree-walk to files.el. |
Date: |
Wed, 03 Dec 2014 20:32:35 +0100 |
User-agent: |
Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.3.91 (gnu/linux) |
Stefan Monnier writes:
>> +before descending into it, and if nil is returned at that point
>> +the descent will be prevented. Directory entries are sorted with
>> +string-lessp"
> ^^^
> Don't forget to punctuate your docstrings.
And string-lessp should be quoted, but it doesn't matter since AFAICS
that sentence isn't true anyway.
>> + (cond ((file-directory-p dir)
>> + (or (char-equal ?/ (aref dir (1- (length dir))))
>> + (setq dir (file-name-as-directory dir)))
>> + (let ((lst (directory-files dir nil nil t))
>
> Experience taught me that file-name-all-completions followed by testing
> the presence of a trailing "/" is *much* faster because calling
> file-directory-p on each entry ends up costly.
>
> I got this trick from Eshell's code for ** globbing, where the speed
> difference was a factor 10 when I tested it.
Apart from that, I find this function confusing. Why not simply call
ACTION with the full filename instead of splitting in into DIR and the
filename sans the directory part (where the latter might actually be a
subdirectory)?
-David
- Re: Metaproblem, part 3, (continued)
- Re: Metaproblem, part 3, Stephen J. Turnbull, 2014/12/06
- Re: Metaproblem, part 3, Eric Abrahamsen, 2014/12/06
- Re: Metaproblem, part 3, David Kastrup, 2014/12/06
- Re: Metaproblem, part 3, Richard Stallman, 2014/12/07
- Re: Metaproblem, part 3, Phillip Lord, 2014/12/05
- Re: Metaproblem, part 3, Eli Zaretskii, 2014/12/05
- Re: Metaproblem, part 3, Phillip Lord, 2014/12/05
- Re: Metaproblem, part 3, Eli Zaretskii, 2014/12/05
Re: [Emacs-diffs] master e820f16: Added file-tree-walk to files.el.,
David Engster <=
- Re: [Emacs-diffs] master e820f16: Added file-tree-walk to files.el., Eric S. Raymond, 2014/12/03
- Re: [Emacs-diffs] master e820f16: Added file-tree-walk to files.el., David Engster, 2014/12/03
- Re: [Emacs-diffs] master e820f16: Added file-tree-walk to files.el., Eric S. Raymond, 2014/12/03
- Re: [Emacs-diffs] master e820f16: Added file-tree-walk to files.el., David Engster, 2014/12/03
- Re: [Emacs-diffs] master e820f16: Added file-tree-walk to files.el., Eric S. Raymond, 2014/12/03
- Re: [Emacs-diffs] master e820f16: Added file-tree-walk to files.el., David Engster, 2014/12/04
- Re: [Emacs-diffs] master e820f16: Added file-tree-walk to files.el., Eli Zaretskii, 2014/12/04
- Re: [Emacs-diffs] master e820f16: Added file-tree-walk to files.el., Stefan Monnier, 2014/12/04
- Re: [Emacs-diffs] master e820f16: Added file-tree-walk to files.el., Glenn Morris, 2014/12/05
Re: [Emacs-diffs] master e820f16: Added file-tree-walk to files.el., Stefan Monnier, 2014/12/03