From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5521 invoked from network); 5 May 2000 11:56:26 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 5 May 2000 11:56:26 -0000 Received: (qmail 24980 invoked by alias); 5 May 2000 11:56:05 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11192 Received: (qmail 24965 invoked from network); 5 May 2000 11:56:05 -0000 Date: Fri, 5 May 2000 13:55:57 +0200 (MET DST) Message-Id: <200005051155.NAA00695@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Tanaka Akira's message of 05 May 2000 20:31:26 +0900 Subject: Re: PATCH: _look Tanaka Akira wrote: > This is a completion function for `look'. It calls `look' itself to > find completions. > > Apart from that, I found that some functions using a state of > _arguments such as _gzip declare `curcontext' instead of `context' > which is specified by zshcompsys(1). Is `curcontext' obsolete? No. Functions should either - Call _arguments as in _gzip, make `context' local and in the state-handling make sure that $context is used in the argument field of the context name. This is what functions like _tags do when given the -C option, so: local context state line typeset -A opt_args _arguments '...:->foo' && return 0 if [[ "$state" = foo ]]; then _tags -C "$context" ... fi (That `&& return 0' is missing in _gzip, too.) Actually, $state and $context nowadays are arrays, because _arguments may return more than one state, but that's only possible if the specs make it possible that more than one argument may be completed in some place. - Call _arguments with the -C option and then make `curcontext' local, initialising it to itself, as is done in _gzip. In that case _arguments will modify $curcontext without making it local to itself so that the state-handling code doesn't need to care about setting up the context. Of course, this only works if only one state can be returned by _arguments. This was the case for all completion functions when I added the multi-state handling to _arguments. In other words, there is a `-C' missing in _gzip (and probably in other functions?). Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de