From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1135 invoked from network); 16 Aug 2004 21:35:12 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 16 Aug 2004 21:35:12 -0000 Received: (qmail 5353 invoked from network); 16 Aug 2004 21:35:05 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 16 Aug 2004 21:35:05 -0000 Received: (qmail 2156 invoked by alias); 16 Aug 2004 21:34:19 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7867 Received: (qmail 2146 invoked from network); 16 Aug 2004 21:34:18 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 16 Aug 2004 21:34:18 -0000 Received: (qmail 2973 invoked from network); 16 Aug 2004 21:32:20 -0000 Received: from pat.uio.no (129.240.130.16) by a.mx.sunsite.dk with SMTP; 16 Aug 2004 21:32:18 -0000 Received: from mail-mx6.uio.no ([129.240.10.47]) by pat.uio.no with esmtp (Exim 4.34) id 1Bwp5U-00053d-Ab for zsh-users@sunsite.dk; Mon, 16 Aug 2004 23:32:16 +0200 Received: from 143.80-203-48.nextgentel.com ([80.203.48.143] helo=s.hn.org) by smtp.uio.no with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1Bwp5O-0006kO-SS for zsh-users@sunsite.dk; Mon, 16 Aug 2004 23:32:10 +0200 Received: (qmail 6943 invoked by uid 1000); 16 Aug 2004 21:32:05 -0000 Date: Mon, 16 Aug 2004 23:32:04 +0200 From: Haakon Riiser To: zsh-users@sunsite.dk Subject: In the tla completion function: "${(@P)var_cmd-*:FILE:_files}" Message-ID: <20040816213204.GA6795@s> Mail-Followup-To: zsh-users@sunsite.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i X-MailScanner-Information: This message has been scanned for viruses/spam. Contact postmaster@uio.no if you have questions about this scanning X-UiO-MailScanner: No virus found X-UiO-Spam-info: not spam, SpamAssassin (score=0, required 12) X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.0 required=6.0 tests=BAYES_01,RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: -0.0 I was just browsing through the new completion function for tla in zsh 4.2.1, and I was wondering about the expression shown in the subject: "${(@P)var_cmd-*:FILE:_files}" >>From what I've read in the manual, I'd guess that the @ flag is a harmless bug that has no effect since $var_cmd is not an array, and that the P flag makes the expression expand to the expansion of the variable name contained in $var_cmd, if $var_cmd is defined; if $var_cmd is not defined, I'd expect the expansion to give the string after the '-': *:FILE:_files I tried it out in an interactive session, but the '-' expansion doesn't work. ## ## This works: ## % myvar=hello % foo=myvar % echo "${(@P)foo-bar}" hello ## ## This does not: ## % unset foo % echo "${(@P)foo-bar}" zsh: bad substitution Is this a bug in the completion file that has gone unnoticed because var_cmd has always been defined? -- Haakon