From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29032 invoked from network); 5 Aug 2005 23:56:17 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 5 Aug 2005 23:56:17 -0000 Received: (qmail 87540 invoked from network); 5 Aug 2005 23:56:10 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Aug 2005 23:56:10 -0000 Received: (qmail 14494 invoked by alias); 5 Aug 2005 23:56:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21565 Received: (qmail 14483 invoked from network); 5 Aug 2005 23:56:08 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 5 Aug 2005 23:56:08 -0000 Received: (qmail 87248 invoked from network); 5 Aug 2005 23:56:08 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 5 Aug 2005 23:56:03 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id 330D070055; Fri, 5 Aug 2005 19:56:03 -0400 (EDT) Date: Fri, 5 Aug 2005 19:56:03 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Cc: Marc Glisse , 311020-forwarded@bugs.debian.org Subject: Re: Bug#311020: zsh: buggy _man completion Message-ID: <20050805235603.GA21750@scowler.net> Mail-Followup-To: zsh-workers@sunsite.dk, Marc Glisse , 311020-forwarded@bugs.debian.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 > These are actually 2 bugs: > > 1) > When I use TAB completion with man, a _manpath array is created. If I > then update $MANPATH, $manpath reflects this change, but however many > times I use the completion on man again, _manpath is not updated, and > completion uses the old MANPATH. Not sure what we can do about that. > 2) > extract from _man: > # Remove any compression suffix, then remove the minimum possible string > # beginning with .<->: that handles problem cases like files called > # `POSIX.1.5'. > > compadd "$@" - ${pages%.(?|<->*)} > > I have a man page called "qui-6.0.1". If I run this command manually, > it indeed gives "qui-6.0". But when I use TAB completion, I see "qui-6". > So either an option is different, or the suffix gets removed some other > place... Notice that if the page is called "qui-6.0.1.gz", it works fine. Thoughts on this? Index: Completion/Unix/Command/_man =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_man,v retrieving revision 1.6 diff -u -r1.6 _man --- Completion/Unix/Command/_man 31 May 2002 05:02:38 -0000 1.6 +++ Completion/Unix/Command/_man 5 Aug 2005 23:54:44 -0000 @@ -82,7 +82,7 @@ pages=( ${(M)dirs:#*$sect/} ) compfiles -p pages '' '' "$matcher" '' dummy '*' - pages=( ${^~pages}(N:t:r) ) + pages=( ${^~pages}(N:t) ) (($#mrd)) && pages[$#pages+1]=($(awk $awk $mrd)) @@ -90,7 +90,7 @@ # beginning with .<->: that handles problem cases like files called # `POSIX.1.5'. - compadd "$@" - ${pages%.(?|<->*)} + compadd "$@" - ${pages%.(?|<->*(|.gz|.bz2|.Z))} } _man "$@"