From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26164 invoked from network); 24 Mar 2000 17:48:51 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 24 Mar 2000 17:48:51 -0000 Received: (qmail 19202 invoked by alias); 24 Mar 2000 17:48:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10235 Received: (qmail 19187 invoked from network); 24 Mar 2000 17:48:27 -0000 From: "Bart Schaefer" Message-Id: <1000324174811.ZM25159@candle.brasslantern.com> Date: Fri, 24 Mar 2000 17:48:11 +0000 In-Reply-To: <200003221256.NAA16720@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "PATCH: tag aliases" (Mar 22, 1:56pm) References: <200003221256.NAA16720@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: Sven Wischnowsky , zsh-workers@sunsite.auc.dk Subject: Re: PATCH: tag aliases MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 22, 1:56pm, Sven Wischnowsky wrote: } Subject: PATCH: tag aliases } } The idea is to let users invent their own tags. This is done with the } tag-order style, the syntax is currently: } } zstyle ':completion:...' tag-order 'foo:bar' } } Here, `foo' is the tag offered by the completion function and `bar' is } the alias. Completion will then proceed as if only `foo' were given, } i.e. the matches for that tag are generated. BUT: instead of using } `foo' to look up style, the function will use `bar'. I wish there were a better word for this than "alias". "Label"? I don't have any strong opinions on the rest of the stuff that Sven's already implemented (10230, 10231) except to agree about not wanting any other nested loops introduced into the process. } And finally: Bart and I had this bit of discussion about changing the } completer field to always contain the `-' suffix. And we didn't } like it. [...] We could make the completer style allow an alias-syntax } like the one from tag-order, too. } } zstyle ':completion:*' completer complete ... complete:foo } } The first invocation of _complete would use the usual } `...:complete:...' in the context name but the second one would use } `...:foo:...' in the completer field. This would best be combined with the change you posted in 10231 so that it became zstyle ':completion:*' completer complete ... complete:-foo so the second call to _complete would use "...:complete-foo:...". } I would then first change the style } so that one doesn't need to give the leading underscores Incidentally,I don't mind having the leading underscores on the completer function names in those styles. It makes it easier to see which arguments are tag names and which ones are function names. Yes, there's only really one tag name, but ... } Anyway... I'd like to hear your comments, suggestions and so } on. Especially about the configuration stuff, but also about the } syntax of the tag-order and file-patterns styles, about the names of } the two new functions (yes, I didn't even try to make them sensible } because I wasn't sure what I was implementing when I started it), and } so on... The only thing I'd suggest about the names of the functions is that they should be less generic; _loop_tags and _try_aliases (or _try_labels if that's a better word for the whole concept, since we already have other things called aliases that it's possible to complete ...). Naming is especially important when --enable-function-subdirs is not used. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com