From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9311 invoked from network); 9 Sep 1999 09:44:56 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 9 Sep 1999 09:44:56 -0000 Received: (qmail 20728 invoked by alias); 9 Sep 1999 09:44:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7738 Received: (qmail 20720 invoked from network); 9 Sep 1999 09:44:36 -0000 Message-Id: <199909090944.LAA10206@paris.ifh.de> X-Authentication-Warning: paris.ifh.de: pws owned process doing -bs To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: PATCH: 3.1.6-pws-3: _man Date: Thu, 09 Sep 1999 11:44:30 +0200 From: Peter Stephenson Unless my brain is even softer than usual, manual completion currently doesn't work with correction and approximation, because it generates the patterns itself. This does the trick, but perhaps there is a more standardised way we could invent. --- Completion/User/_man.old Mon Aug 30 13:28:34 1999 +++ Completion/User/_man Thu Sep 9 11:02:49 1999 @@ -2,12 +2,23 @@ setopt localoptions rcexpandparam -local rep expl +local rep expl star approx + +if [[ $compstate[pattern_match] != [^*] ]]; then + # If a string other than *, we just want correction, so no `*'. + star='*' +fi + +if [[ -n $_comp_correct ]]; then + # If this is set, we are correcting with this many approximations. + approx="(#a${_comp_correct})" +fi if [[ $words[2] = (<->*|ln) ]]; then - rep=( $manpath/(man|cat)${words[2]}/$PREFIX*$SUFFIX.<->*(N:t:r) ) + rep=( + $manpath/(man|cat)${words[2]}/${~approx}$PREFIX${~star}$SUFFIX.<->*(N:t:r) ) else - rep=( $manpath/(man|cat)*/$PREFIX*$SUFFIX.<->*(N:t:r) ) + rep=( $manpath/(man|cat)*/${~approx}$PREFIX${~star}$SUFFIX.<->*(N:t:r) ) fi _description expl 'manual page' -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56100 Pisa, Italy