From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20934 invoked from network); 21 Aug 2001 06:39:02 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Aug 2001 06:39:02 -0000 Received: (qmail 8660 invoked by alias); 21 Aug 2001 06:38:51 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4157 Received: (qmail 8647 invoked from network); 21 Aug 2001 06:38:50 -0000 From: Bart Schaefer Message-Id: <1010821063843.ZM20952@candle.brasslantern.com> Date: Tue, 21 Aug 2001 06:38:43 +0000 In-Reply-To: <001501c12a0a$564ed110$21c9ca95@mow.siemens.ru> Comments: In reply to Borsenkow Andrej "RE: Few newbie questions.." (Aug 21, 10:27am) References: <001501c12a0a$564ed110$21c9ca95@mow.siemens.ru> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-users@sunsite.dk Subject: Re: Few newbie questions.. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 21, 10:27am, Borsenkow Andrej wrote: } } > 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. } } No, it should be O.K. Except, of course, that I forgot the fallback condition. Here's the more correct patch (the missing bit was + else + sect=$words[2] ). Index: Completion/Unix/Command/_man =================================================================== --- Completion/Unix/Command/_man 2001/07/10 09:05:14 1.3 +++ Completion/Unix/Command/_man 2001/08/21 06:35:55 @@ -22,9 +22,20 @@ 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 + else + sect=$words[2] + 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