From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2287 invoked from network); 21 Aug 2001 02:55:53 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Aug 2001 02:55:53 -0000 Received: (qmail 17225 invoked by alias); 21 Aug 2001 02:55:40 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4155 Received: (qmail 17213 invoked from network); 21 Aug 2001 02:55:38 -0000 From: Bart Schaefer Message-Id: <1010821025509.ZM20813@candle.brasslantern.com> Date: Tue, 21 Aug 2001 02:55:09 +0000 In-Reply-To: <20010821003456.A9481@greux.loria.fr> Comments: In reply to Vincent Lefevre "Re: Few newbie questions.." (Aug 21, 12:34am) References: <20010817173924.73063.qmail@web20304.mail.yahoo.com> <1010818032514.ZM14858@candle.brasslantern.com> <20010821003456.A9481@greux.loria.fr> X-Mailer: Z-Mail (5.0.0 30July97) To: Vincent Lefevre , zsh-users@sunsite.dk Subject: Re: Few newbie questions.. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 21, 12:34am, Vincent Lefevre wrote: } Subject: Re: Few newbie questions.. } } On Sat, Aug 18, 2001 at 03:25:13 +0000, Bart Schaefer wrote: } > } > zsh% man 7 lo } } But this doesn't work under Solaris, where you need the -s option. Try this patch. It handles -s, -S, and $MANSECT. However, I don't know what it does with the awk stuff in _man_pages -- it's possible that the assignment to $awk needs to be adjusted as well. Index: Completion/Unix/Command/_man =================================================================== --- Completion/Unix/Command/_man 2001/07/10 09:05:14 1.3 +++ Completion/Unix/Command/_man 2001/08/21 02:48:25 @@ -22,9 +22,18 @@ mrd=(${^manpath/\%L/${LANG:-En_US.ASCII}}/mandb(N)) - if [[ $words[2] = (<->*|1M|l|n) ]]; then - dirs=( $^manpath/(sman|man|cat)${words[2]}/ ) - awk="\$2 == \"$words[2]\" {print \$1}" + local sect + if [[ $OSTYPE = solaris* ]]; then + sect=$words[$words[(i)-s]+1] + elif [[ -n ${sect:=$words[$words[(i)-S]+1]} || -n ${sect:=$MANSECT} ]]; then + if [[ $sect != ${sect::="${sect//:/|}"} ]]; then + sect="($sect)" + fi + fi + + if [[ $sect = (<->*|1M|l|n) || $sect = \((*\|*)\) ]]; then + dirs=( $^manpath/(sman|man|cat)${~sect}/ ) + awk="\$2 == \"$sect\" {print \$1}" else dirs=( $^manpath/(sman|man|cat)*/ ) awk='{print $1}' -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net