From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3258 invoked from network); 1 May 2004 05:43:34 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by ns1.primenet.com.au with SMTP; 1 May 2004 05:43:34 -0000 Received: (qmail 5584 invoked from network); 1 May 2004 05:43:19 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 1 May 2004 05:43:19 -0000 Received: (qmail 13800 invoked by alias); 1 May 2004 05:43:14 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19863 Received: (qmail 13791 invoked from network); 1 May 2004 05:43:14 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 1 May 2004 05:43:11 -0000 Received: (qmail 5207 invoked from network); 1 May 2004 05:43:10 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 1 May 2004 05:43:08 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id E6CDE7004B; Sat, 1 May 2004 01:42:41 -0400 (EDT) Date: Sat, 1 May 2004 01:42:41 -0400 From: Clint Adams To: Bart Schaefer Cc: zsh-workers@sunsite.dk, 246305-submitter@bugs.debian.org Subject: Re: Bug#246305: zsh: completion for sudo doesn't add commands under root's path Message-ID: <20040501054241.GA11506@scowler.net> References: <877jw0gzp3.wl@broken.int.wedontsleep.org> <20040428130449.GA3198@scowler.net> <1040428160206.ZM29342@candle.brasslantern.com> <20040430122712.GA2985@scowler.net> <17443.1083331282@trentino.logica.co.uk> <20040430153937.GA4644@scowler.net> <1040430162512.ZM1310@candle.brasslantern.com> <20040501050229.GA11064@scowler.net> <1040501052546.ZM1893@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1040501052546.ZM1893@candle.brasslantern.com> User-Agent: Mutt/1.5.5.1+cvs20040105i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-1.5 required=6.0 tests=BAYES_01 autolearn=no version=2.63 X-Spam-Hits: -1.5 > So I'd suggest something like: > > local -a cmdpath > if zstyle -a ":completion:${curcontext}" command-path cmdpath && > [[ $#cmdpath -gt 0 ]] Okay, verbatim but for the comment. BTW, I don't know if it's just me, but verizon.net is rejecting direct mail to Bart. Index: Completion/Zsh/Type/_command_names =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_command_names,v retrieving revision 1.6 diff -u -r1.6 _command_names --- Completion/Zsh/Type/_command_names 3 Sep 2003 10:15:35 -0000 1.6 +++ Completion/Zsh/Type/_command_names 1 May 2004 05:40:32 -0000 @@ -33,4 +33,12 @@ args=( "$@" ) +local -a cmdpath +if zstyle -a ":completion:${curcontext}" command-path cmdpath && + [[ $#cmdpath -gt 0 ]] +then + local -a +h path + local -A +h commands + path=( $cmdpath ) +fi _alternative -O args "$defs[@]" Index: Doc/Zsh/compsys.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/compsys.yo,v retrieving revision 1.174 diff -u -r1.174 compsys.yo --- Doc/Zsh/compsys.yo 29 Feb 2004 12:09:11 -0000 1.174 +++ Doc/Zsh/compsys.yo 1 May 2004 05:40:34 -0000 @@ -1140,6 +1140,11 @@ care should be taken to specify only commands that take a short time to run, and in particular to avoid any that may never terminate. ) +kindex(command-path, completion style) +item(tt(command-path))( +This is a list of directories to search for commands to complete. The +default for this style is the value of the special parameter tt(path). +) kindex(commands, completion style) item(tt(commands))( This is used by the function completing sub-commands for the system