From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76 invoked from network); 7 Jun 2004 08:44:32 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 7 Jun 2004 08:44:32 -0000 Received: (qmail 19262 invoked from network); 7 Jun 2004 08:43:48 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Jun 2004 08:43:48 -0000 Received: (qmail 4608 invoked by alias); 7 Jun 2004 08:43:38 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7494 Received: (qmail 4598 invoked from network); 7 Jun 2004 08:43:38 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 7 Jun 2004 08:43:35 -0000 Received: (qmail 18189 invoked from network); 7 Jun 2004 08:43:26 -0000 Received: from mail02.hansemerkur.de (217.6.199.140) by a.mx.sunsite.dk with SMTP; 7 Jun 2004 08:43:24 -0000 Received: from gateway.hansemerkur.de (unknown [217.6.199.129]) by mail02.hansemerkur.de (Postfix) with SMTP id 657782750B for ; Mon, 7 Jun 2004 10:42:56 +0200 (CEST) Received: from fs-prx1.hansemerkur.de (unverified) by mailsweeper01.hansemerkur.de (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Mon, 7 Jun 2004 10:42:45 +0200 Received: from DOM3-MTA by fs-prx1.hansemerkur.de with Novell_GroupWise; Mon, 07 Jun 2004 10:42:45 +0200 Message-Id: X-Mailer: Novell GroupWise Internet Agent 6.5.0 Date: Mon, 07 Jun 2004 10:42:11 +0200 From: "Michael Dettmer" To: Cc: Subject: Re: man page completion / regexp Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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=none autolearn=no version=2.63 X-Spam-Hits: 0.0 Hi, looks rather complicated to me Here's my solution for Solaris only: (part of .zprofile) MNPG="'"`echo $MANPATH|awk -F: '{for(i=1;i<=NF;i++)printf("%s/*/*(:t) ",$i)}'`"'" compctl -g $MNPG man Michael. >>> Jarkko Maja 06.06.2004 12:09:44 >>> Hi, I'm have in my zsh-4.0.7 ~/.zshrc the following for man page completion: # man page completion man_glob () { local a b manp cat read -cA a read -lA b manp=`manpath 2> /dev/null` || manp=`echo "$MANPATH"` [[ "$OSTYPE" = *bsd* ]] && cat=,cat if [[ "$a[2]" = [0-9nlpo](|p) ]] # && [[ -n "$a[3]" || "${(M)b% }" = " " ]] then reply=( ${^$(echo $manp | sed -e 's/:/ /g')}/{man,sman$cat}$a[2]/$1*(-N.:t) ) else reply=( ${^$(echo $manp | sed -e 's/:/ /g')}/{man,sman$cat}[0-9nlpo]{,X,m}*/$1*(-N.:t) ) fi reply=( ${reply%.[^0-9Xmnlpo]*} ) # Uncomment to strip trailing section names from reply #reply=( ${reply%.[0-9Xmnlpo]*} ) } compctl -K man_glob -x 'C[-1,-P]' -m - \ 'R[-*l*,;]' -g '*.(man|[0-9Xmnlpo](|[a-z]))' -- + -f -g '..' man # Uncomment to accept man page names with trailing section names, e.g., man.1 man () { local test=${(M)@#*/} # File name probably contains a slash if [[ -z "$test" ]] && [[ $# -lt 3 ]] then command man ${(M)${${(M)@%.[0-9Xmnlpo]*}#.}#[0-9Xmnlpo]} ${@%.[0-9Xmnlpo]*} else command man "$@" fi } This works perfect in Linux/*BSD/Solaris. E.g., man locale[TAB] gives: locale.1 locale.5 locale.7 etc and man locale.7 becomes man 7 locale. And man 7 locale[TAB] shows only locale.7. However, with newer versions of Linux's man-pages package there are also sections like 0p, 1p, 3p and, e.g., man man.1p becomes man 1 man. So, to overcome this, I got man 1p man by this: command man ${(M)${${(M)@%.[0-9Xmnlpo]*}#.}%%[0-9Xmnlpo](|p)} ${@%.[0-9Xmnlpo]*} But then I have problem because man X509_NAME_ENTRY_create_by_NID.3ssl becomes to man l X509_NAME_ENTRY_create_by_NID and previously it was correctly man 3 ... Also there man pages in dir man/man3 like LWP.3pm. Any hints are welcome, I've pretty much tested everything I can imagine. If you can get this working, I'd be delighted to know how to fix this! Thanks in advance. __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/