From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17782 invoked by alias); 1 Oct 2014 18:14:48 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19195 Received: (qmail 14073 invoked from network); 1 Oct 2014 18:14:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_WEB,RCVD_NUMERIC_HELO,SPF_HELO_PASS,T_FSL_HELO_BARE_IP_2 autolearn=no version=3.3.2 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: Yuri D'Elia Subject: Re: Empty directories Date: Wed, 01 Oct 2014 20:14:16 +0200 Message-ID: References: <20141001120022.72b2bf53@pwslap01u.europe.root.pri> <20141001142506.52d75405@pwslap01u.europe.root.pri> <141001084733.ZM5806@torch.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 193.106.183.2 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.0 In-Reply-To: <141001084733.ZM5806@torch.brasslantern.com> On 10/01/2014 05:47 PM, Bart Schaefer wrote: > On Oct 1, 4:47pm, Yuri D'Elia wrote: > } > } I tried to look into _path_files, and there's actually a special rule to > } handle empty directories, though I got lost in the expansion loop. > > I'm not entirely sure (see "no one really understands") but I think that > rule is for handling partial path completion, that is, given "a/b/c" it > eliminates empty directories matching a* or a*/b* -- because it knows it > has to get as far as a*/b*/c*, so empty dirs along the way are useless. Ok, so maybe we can cut it short and avoid to append a slash on empty directories directly on the first run? This would stop path completion immediately.