[Top][All Lists]

[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: Eric S. Raymond
Subject: Re: [Emacs-diffs] master e820f16: Added file-tree-walk to files.el.
Date: Wed, 3 Dec 2014 14:31:10 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

Stefan Monnier <address@hidden>:
> > +(defun file-tree-walk (dir action &rest args)
> > +  "Walk DIR executing ACTION.  Each call gets as arguments DIR, a file 
> > path,
> The first line should be self-sufficient, so better add a newline after
> the ".".
> > +and optional ARGS. The ACTION is applied to each subdirectory
>                     ^^
> Use two spaces to separate sentences.
> > +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.
> I think C-u M-x checkdoc-current-buffer RET would have caught all those.
> We really should try and setup flymake.el automatically for Elisp
> buffers to flag those things on-the-fly.
> > +  (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.

I can fix these things easily enough, of course.  But since you got annoyed
about the last commit message, I need to know of this kind of fix requires
a ChangeLog entry.
                <a href="http://www.catb.org/~esr/";>Eric S. Raymond</a>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]