From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6243 invoked by alias); 27 May 2011 15:16:59 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29401 Received: (qmail 4788 invoked from network); 27 May 2011 15:16:57 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.212.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=A0ohZdTpcrIF1iqTeYImBY7Icssg2Zv0eVXoqVc1Q4I=; b=yFL987SuCEtiXufgg6y7NRMNz4TXT1Dncql2JRWZlW947L+nIbyjwbAIMgHl3YhDw+ ckunZ0/ood9sCoUH1vZZuUKegPj9thlCStcnacZw3ywH2ohvgu4NMYyRODrE3Urtgbmp xmqKvXAHItFE+KcWrnk3irzm8uPhgjv/4pBsU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=If3ZssHHJkEBBecYE1WgczyvRur8jnysaa24cGpcP9O+qLsDgfs/aHoaapUY5B8/wo Lc0E8sZh62bqZ9XwCK0+3VEghoxHSEoO10AAJuiZbOQ5/0sZ4aYyWAPWIvu1dY9a0JEh Lb/fCbofJd0svvojDaHwim93racd2KzxDPdE4= MIME-Version: 1.0 In-Reply-To: <110527080643.ZM6124@torch.brasslantern.com> References: <237967ef0902140622s7389d2c8h5a0c786dcf207422@mail.gmail.com> <200902141801.n1EI1E2l003603@pws-pc.ntlworld.com> <237967ef0902141019t30118690m30116c9413015d96@mail.gmail.com> <090214111316.ZM15188@torch.brasslantern.com> <237967ef0902141141y609b61d3i154546f6f6886c65@mail.gmail.com> <090214133904.ZM15383@torch.brasslantern.com> <20090216094632.30502fe9@news01> <237967ef0902160155m583e714fqe9bbd344420f1ce0@mail.gmail.com> <110526214110.ZM518@torch.brasslantern.com> <110526223650.ZM804@torch.brasslantern.com> <110527080643.ZM6124@torch.brasslantern.com> Date: Fri, 27 May 2011 17:16:52 +0200 Message-ID: Subject: Re: Problem with fake-files style and cd From: Mikael Magnusson To: Bart Schaefer Cc: zsh-workers Content-Type: text/plain; charset=UTF-8 On 27 May 2011 17:06, Bart Schaefer wrote: > On May 27, 4:24pm, Mikael Magnusson wrote: > } Subject: Re: Problem with fake-files style and cd > } > } Or is this better? > } > } item(tt(directories))( > } for names of directories DASH()- tt(local-directories) is used instead > } when completing arguments of tt(cd) and related builtin commands when > } the tt(cdpath) array is set > > I like that one, but either is fine. Okay, good :). > } I think it's enough that the entry for local-directories refers the > } reader to path-directories. It's heavily implied that path-directories > } does nothing when cdpath is empty too. What is the motivation though? > > zsh-workers/8869 (twelve years ago): > > This makes _cd use the tags local-directories and path-directories to > decide if those in the cwd and/or those in $cdpath should be > completed. > > I.e. you can put in your _sort_tags: > > *::cd:*) > comptry local-directories > comptry path-directories > ;; > > to first complete only the directories in $PWD and the ones in $cdpath > only if that fails. > > Obviously this predates a whole lot of mechansim that now exists; e.g., > _sort_tags is now the tag-order style. There's a follow-up from me in > workers/8878 and then Sven in 8880 (not properly linked in the archive). > > } Why not just always have just 'directories' and then also look up > } path-directories when cdpath is set, otherwise not? Does someone > } actually want local directories to complete differently depending on > } $cdpath? > > If you have two directories with the same name, one local and one in > a directory in cdpath, you may want that name to appear twice so you > know which one you're actually cd'ing into. Otherwise the duplicate > would be suppressed when generating the completion listing. Would it? One would be in 'directories' and one would be in 'path-directories', same as now except the first one is in local-directories. What I meant was path-directories would stay, but local-directories would be folded into directories, since they never appear at the same time anyway. I suppose the issue is academic since we can't break existing configurations though. > Of course (as discussed in 8878 and 8880) it would be silly to use > the tags to order the completions differently than the way cdpath is > used by cd et al. Hmm, there might be a way with the tags to cause > completion to explicitly expand paths (force "$PWD/" in front of the > local-directories, for example) to eliminate the ambiguity, but I'm > not going to try to figure that out. Do you mean in front of the path-directories? cd goes to local directories first, and then cdpath. -- Mikael Magnusson