From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5926 invoked from network); 5 Jul 2000 14:07:27 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 5 Jul 2000 14:07:27 -0000 Received: (qmail 17359 invoked by alias); 5 Jul 2000 14:07:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12173 Received: (qmail 17352 invoked from network); 5 Jul 2000 14:07:11 -0000 Message-ID: <396340E6.425E3B89@u.genie.co.uk> Date: Wed, 05 Jul 2000 15:06:30 +0100 From: Oliver Kiddle X-Mailer: Mozilla 4.73 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: zsh-workers@sunsite.auc.dk Subject: using modules in completion functions Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit While looking through the manual, I noticed the disable-stat style is used for cvs completion when deciding whether to load the stat module. For completing file descriptors, I had taken a different approach where the stat module was used if already loaded but if not, ls is used. I would expect that it will be a fairly common situation that we will have where a completion function can make good use of a module but can cope without it and we have to decide whether or not to use it. It would therefore be a good idea if we agreed on a common way to handle this. What I would suggest is a style named something like use-module which can be set to one of three values which would correspond to: 1. always use the module, loading it if necessary 2. never use the module 3. use the module but only if it is already loaded where the third should probably be the default The name of the module could be placed somewhere in the context. Where would it make sense to put it - the argument, as a sub-command or elsewhere? If it can't go in the context, I suppose we could have separate styles such as use-module-stat but that wouldn't be so good in my opinion. Oliver