From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12830 invoked from network); 12 Apr 2000 03:27:16 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 Apr 2000 03:27:16 -0000 Received: (qmail 13301 invoked by alias); 12 Apr 2000 03:27:06 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10681 Received: (qmail 13282 invoked from network); 12 Apr 2000 03:27:05 -0000 From: "Bart Schaefer" Message-Id: <1000412032653.ZM11732@candle.brasslantern.com> Date: Wed, 12 Apr 2000 03:26:53 +0000 In-Reply-To: <20000411235752.A2739@thelonious.new.ox.ac.uk> Comments: In reply to Adam Spiers "_complete_help troubles" (Apr 11, 11:57pm) References: <20000411212619.A1605@thelonious.new.ox.ac.uk> <000411145025.ZM8942@candle.brasslantern.com> <20000411235752.A2739@thelonious.new.ox.ac.uk> X-Mailer: Z-Mail (5.0.0 30July97) To: Adam Spiers , zsh workers mailing list Subject: Re: _complete_help troubles MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Apr 11, 11:57pm, Adam Spiers wrote: } Subject: _complete_help troubles } } > > $ ls } > > _complete_help:39: bad pattern: \n all-files (_files _default) BTW, you do mean there, and not , right? If _complete_help is running when you hit TAB, either you have rather surprising bindkeys, or something very bad is happening. } The relevant bit of trouble-making code is: } } for i in "${(@ok)help_funcs}"; do } text="${text} } tags in context :completion:${i}:" } tmp=() } for j in "${(@s.:.)help_funcs[$i][2,-1]}"; do } tmp=( "$tmp[@]" "${(@s.,.)help_tags[${i}${j}][2,-1]}" ) } done } zformat -a tmp ' (' "$tmp[@]" } tmp=( ' } '${^tmp}')' ) <<<<<< this line gives the error } text="${text}${tmp}" } done } } tmp has the value `all-files (_files _default' when the error occurs, } which doesn't look right. No, that is in fact right. The output should look something like zagzig[99] ls tags in context :completion::complete:ls:: all-files (_files _default) and you'll note the ')' on the failing line. However, look at this: zagzig[99] setopt shwordsplit zagzig[100] ls tags in context :completion::complete:ls:: all-files) (_files) _default) I'm entirely certain that's NOT supposed to happen. And then: zagzig[109] setopt globsubst zagzig[110] ls _complete_help:39: bad pattern: \n (_files) So the problem is that _complete_help is expecting the standard options from _main_complete, but of course it doesn't get them because it's not called through the regular completion system. Maybe we should put these (without localoptions, obviously) in another function that can be called to install the standard completion options? Except that rcexpandparam worries me just a tad ... Index: Completion/Commands/_complete_help =================================================================== @@ -1,6 +1,9 @@ #compdef -k complete-word \C-xh _complete_help() { + setopt localoptions nullglob rcexpandparam extendedglob + unsetopt markdirs globsubst shwordsplit nounset ksharrays + local _sort_tags=_help_sort_tags text i j k typeset -A help_funcs help_tags help_sfuncs help_styles -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com