From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Eric S. Raymond" Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master e820f16: Added file-tree-walk to files.el. Date: Wed, 3 Dec 2014 14:31:10 -0500 Organization: Eric Conspiracy Secret Labs Message-ID: <20141203193110.GF12748@thyrsus.com> References: <20141203142859.24393.98673@vcs.savannah.gnu.org> Reply-To: esr@thyrsus.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1417635129 4781 80.91.229.3 (3 Dec 2014 19:32:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Dec 2014 19:32:09 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 03 20:32:03 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XwFed-0002GB-Fp for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2014 20:32:03 +0100 Original-Received: from localhost ([::1]:43045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwFed-0005x4-42 for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2014 14:32:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwFeM-0005wT-73 for emacs-devel@gnu.org; Wed, 03 Dec 2014 14:31:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XwFeG-00087s-S0 for emacs-devel@gnu.org; Wed, 03 Dec 2014 14:31:46 -0500 Original-Received: from static-71-162-243-5.phlapa.fios.verizon.net ([71.162.243.5]:57905 helo=snark.thyrsus.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwFeG-00087k-MG for emacs-devel@gnu.org; Wed, 03 Dec 2014 14:31:40 -0500 Original-Received: by snark.thyrsus.com (Postfix, from userid 1000) id 5F447382EFA; Wed, 3 Dec 2014 14:31:10 -0500 (EST) Content-Disposition: inline In-Reply-To: X-Eric-Conspiracy: There is no conspiracy User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 71.162.243.5 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:178759 Archived-At: Stefan Monnier : > > +(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. -- Eric S. Raymond