From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18254 invoked by alias); 10 Oct 2013 19:41:05 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31812 Received: (qmail 6322 invoked from network); 10 Oct 2013 19:40:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <131010124113.ZM4512@torch.brasslantern.com> Date: Thu, 10 Oct 2013 12:41:13 -0700 In-reply-to: <131009200134.ZM3418@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: Bug: Completion of the 'zsh' command." (Oct 9, 8:01pm) References: <525564FE.3030705@gmail.com> <131009200134.ZM3418@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Bug: Completion of the 'zsh' command. MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Oct 9, 8:01pm, Bart Schaefer wrote: } } Furthermore, I don't remember what '*:' does for _arguments Figured out that it's shorthand for '*:::' which causes _arguments to go though this branch (some whitespace removed for compactness): if [[ "$action" = \ # ]]; then # An empty action means that we should just display a message. _message -e "$subc" "$descr" } there is first a call to _arguments which has the unintended (?) side- } effect of erasing compstate[insert]. That's coming from "_message -e ..." which has: (( $compstate[nmatches] )) || compstate[insert]= The problem of course is that we haven't finished generating all the matches yet, so it's premature to test (( $compstate[nmatches] )). Several possible approaches come to mind: (1) The patch I already sent, which assures that this call to _message happens late enough for $compstate[nmatches] to be valid. (2) Instead of '*:' aka '*:::' as the last argument of _arguments in _sh, actually give it an action, '*:::_default' (or something more clever). This bypasses the call to _message -e, but makes it appear that every zsh option (except -c) takes an argument, which (I think) changes the zstyle context ... which probably hardly ever matters, but ... (3) Fiddle with _message somehow, for example, shove the assignment to compstate[insert] into a comppostfuncs callback -- except then I'm not sure it happens soon enough, so we've exchanged one problem for another. Anybody have an opinion?