From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id EAA11470 for ; Tue, 23 Jul 1996 04:20:28 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id OAA28237; Mon, 22 Jul 1996 14:14:29 -0400 (EDT) Resent-Date: Mon, 22 Jul 1996 14:13:29 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199607221811.UAA12820@turan.elte.hu> Subject: Re: completing second argument of cd To: schaefer@nbn.com Date: Mon, 22 Jul 1996 20:11:25 +0200 (MET DST) Cc: pws@ifh.de, zsh-users@math.gatech.edu In-Reply-To: <960722092318.ZM8604@candle.brasslantern.com> from Bart Schaefer at "Jul 22, 96 09:23:18 am" Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368 X-Mailer: ELM [version 2.4ME+ PL15 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"xsg6n2.0.Wu6.8Jyyn"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/322 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > On Jul 22, 4:59pm, Zoltan Hidvegi wrote: > } Subject: Re: completing second argument of cd > } > } Have a look at Misc/compctl-examples and Functions/cdmatch2. > > These examples would be a lot more helpful if they included some comments > explaining which of zsh's baroque parameter manipulation features they are > (ab)using, and why. It's pretty obvious that Peter's function and Zoltan's > are both doing the same basic thing; but I have NO idea what reply[(r)] > in Zoltan's version means, since according to the documentation the (r) > should be followed by a pattern. There is a pattern, don't you see that :-) ? There is an empty pattern. The [[ ${#reply[(r),-1]} != 0 ]] && reply[(r)]="''" line just replaces an empty array element with a '' since zle_tricky does not properly quotes empty strings. Unfortunately replacing the empty sring to '' in quotename() does not help since it messes up completion if there is an empty string in the list. Zoltan