From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17266 invoked from network); 18 May 2006 22:09:37 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 May 2006 22:09:37 -0000 Received: (qmail 80680 invoked from network); 18 May 2006 22:09:31 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 May 2006 22:09:31 -0000 Received: (qmail 1892 invoked by alias); 18 May 2006 22:09:22 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10279 Received: (qmail 1882 invoked from network); 18 May 2006 22:09:21 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 18 May 2006 22:09:21 -0000 Received: (qmail 79578 invoked from network); 18 May 2006 22:09:21 -0000 Received: from ms-1.rz.rwth-aachen.de (HELO ms-dienst.rz.rwth-aachen.de) (134.130.3.130) by a.mx.sunsite.dk with SMTP; 18 May 2006 22:09:20 -0000 Received: from r220-1 (r220-1.rz.RWTH-Aachen.DE [134.130.3.31]) by ms-dienst.rz.rwth-aachen.de (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0IZH004D5EVJ1C@ms-dienst.rz.rwth-aachen.de> for zsh-users@sunsite.dk; Fri, 19 May 2006 00:09:19 +0200 (MEST) Received: from relay.rwth-aachen.de ([134.130.3.1]) by r220-1 (MailMonitor for SMTP v1.2.2 ) ; Fri, 19 May 2006 00:09:19 +0200 (MEST) Received: from fsst.voodoo.lan (u-4-163.vpn.RWTH-Aachen.de [137.226.100.163]) by relay.rwth-aachen.de (8.13.6/8.13.3/1) with ESMTP id k4IM9IgY015183 for ; Fri, 19 May 2006 00:09:18 +0200 (MEST) Received: from hawk by fsst.voodoo.lan with local (Exim 4.62) (envelope-from ) id 1Fgqg7-0003M3-Kg for zsh-users@sunsite.dk; Fri, 19 May 2006 00:09:07 +0200 Date: Fri, 19 May 2006 00:09:07 +0200 From: Frank Terbeck Subject: Re: menuselection with manpages In-reply-to: <20060517151015.GK7968@fsst.voodoo.lan> To: zsh users Mail-followup-to: zsh users Message-id: <20060518220907.GX7968@fsst.voodoo.lan> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Content-disposition: inline Operating-System: Linux 2.6.16.1 i686 User-Agent: Mutt/1.5.11+cvs20060403 References: <20060517151015.GK7968@fsst.voodoo.lan> Frank Terbeck : > I'm using completion for the 'man' command with menuselection (sorted > by sections). Now, if I enter 'man cron' I am dropped into a > selection for crontab(1) crontab(5) and cron(8). [...] > How would I get the completion to add the section to the completion, > like 'man 5 crontab'? Hi. I found some time this evening, so I played around with the _man function a little bit. The required change was pretty simple: [snip] --- _man.old 2006-05-18 23:46:40.000000000 +0200 +++ _man 2006-05-18 23:44:57.000000000 +0200 @@ -90,7 +90,7 @@ # beginning with .<->: that handles problem cases like files called # `POSIX.1.5'. - compadd "$@" - ${pages%.(?|<->*(|.gz|.bz2|.Z))} + compadd "$@" -P "$sect " - ${pages%.(?|<->*(|.gz|.bz2|.Z))} } _man "$@" [snap] This works pretty nice, however, if you do this: % man 5 cront it expands to: % man 5 5 crontab which is not what I would want. How could I get this to work sanely? As in: Only add the section if none was specified. Regards, Frank