From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24775 invoked from network); 15 Oct 2003 05:13:55 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 15 Oct 2003 05:13:55 -0000 Received: (qmail 12131 invoked by alias); 15 Oct 2003 05:13:41 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6703 Received: (qmail 12084 invoked from network); 15 Oct 2003 05:13:41 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 15 Oct 2003 05:13:41 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [4.3.58.249] by sunsite.dk (MessageWall 1.0.8) with SMTP; 15 Oct 2003 5:13:40 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id h9F5Dcr23148 for zsh-users@sunsite.dk; Tue, 14 Oct 2003 22:13:38 -0700 From: Bart Schaefer Message-Id: <1031015051338.ZM23147@candle.brasslantern.com> Date: Wed, 15 Oct 2003 05:13:38 +0000 In-Reply-To: <20031014230217.GB867@DervishD> Comments: In reply to DervishD "compctl -l" (Oct 15, 1:02am) References: <20031014230217.GB867@DervishD> X-Mailer: Z-Mail (5.0.0 30July97) To: Zsh Users Subject: Re: compctl -l MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii (If anyone else would like to jump in, here ... I miss Sven. :-) On Oct 15, 1:02am, DervishD wrote: } } I'm trying to learn now the old completion code (compctl), but } I'm clueless with option '-l'. Have you looked at Misc/compctl-examples yet? "compctl -l foo bar" means that, if there exists a compctl for "foo", then use that when completing arguments of "bar". It's like aliasing. If there is not a compctl for "foo", it's useless. "compctl -l '' bar" means that "bar" should be ignored for purposes of completion; that is, the first word after "bar" completes as a command, and the second and further words complete as arguments of the command named by the first word. The classic example is compctl -l '' nohup noglob exec nice eval - time rusage "compctl -x ... -l ..." is the real meat; the arguments to -x tell how to delimit a portion of the command line, and then -l says that when the cursor is within those limits, completion should behave as in one of the two cases above. Note that order is important with "-x": if the "-l" comes *before* the "-x" as in compctl -l '' -x 'p[1]' -f -- . source then that means to ignore "source" or "." only when the -x arguments are false -- in this example, 'p[1]' means "the cursor is in the first word after the command name"; when 'p[1]' is true, files ("-f") are completed, otherwise "-l ''" is used, so the file name is treated as a command name and the compctl for that (if any) is used to complete the other arguments. Of course this stuff about -x generalizes to other options besides -l, but -l is what you were asking about ...