From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2459 invoked from network); 25 Feb 1999 13:33:40 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Feb 1999 13:33:40 -0000 Received: (qmail 26867 invoked by alias); 25 Feb 1999 13:33:14 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5526 Received: (qmail 26859 invoked from network); 25 Feb 1999 13:33:11 -0000 From: "Andrej Borsenkow" To: "Sven Wischnowsky" , Subject: RE: change to __path_files and clean up of Functions/Completion needed Date: Thu, 25 Feb 1999 16:32:26 +0300 Message-ID: <001301be60c3$48911730$21c9ca95@mowp.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2377.0 In-reply-to: <199902231026.LAA24103@beta.informatik.hu-berlin.de> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800 Importance: Normal > > > > I think, it is unacceptable. It is the same, as if users had to modify C > > sources to change compctl behaviour. > > I don't think so. This is shell code after all. O.K. I hope it is not too late. The good old completion has some nice features: 1. It works out-of-the-box. Not setup is needed; immediately after installing zsh users can start with compctl. 2. it is easy to modify completion on-the-fly. What is important, it is the same command with the same syntax as used in startup files. It is invariant - 'compctl $(compctl -L cd) cd' is noop as it should be. 3. it is easy to use. It is not a joke. Using compctl amounts simply to listing what is considered a match - no shell programming is needed. It can be used immediately after reading manual. (Please, I know about -K. But most cases are actually quite simple). What's more important, no shell porgramming is needed for extended/conditional completion. All is limited to a single command. 4. (this is of more personal nature) It does not pollute namespace (why don't we have anonymous functions :) It does not suddenly defines variables/functions/aliases that a completion user is not interested in at all (and probably, should not know of as well) I think, it is time to decide, if we want new style completion be for wizards only or intended for general user community. If it should be of general use, it should be at least as easy to use, as compctl. Exactly for these reasons my first reaction was to stay with compctl as a single entry point and use new style completion to extend it's ability. What I suggest, is some framework that IMHO makes new completion almost as easy to use as compctl. 1. use separate array (cpath?) for a completion stuff. Mixing it with fpath is probably a bad idea (at least, I suddenly get a bunch of autoloaded functions that actually dont exist :) 2. automatically install at least run-time for new completion (and probably the completion for zsh builtins) in standard system-wide location and initialize cpath to point to this location 3. provide a single command to make life easier (compctl is taken, sigh) This command would need at least init - initialize completion. Traverse cpath loading definitions. This would allow users to override system-wide completion by adding own directories to cpath after system location load - load a (single) definition. With options to read from stdio, single file or a directory. And may be directly as argument. Great for testing :) dump - printout of current definition(s) for selected command(s) (--default-- etc). This should be directly usable as input to load. 4. The run-time for completion stuff should _not_ require modification. Even more so, because these functions are very close to winners of Obfuscated Zsh Programming Contest :-) This command should behave as function (or be implemented as such). This allows to start with emulate -RL zsh, set all needed options (extendedglob problem :), define any needed local variables without fear to stomp on user's environment. Anything, that this function exports, should 'course be documented. In this case, all pluses of compctl are retained. Users can start with 'xxx init' (with additional advantage, that they immediately get standard completions for builtins), modify a simgle completion with 'xxx load' and look at what's going on with 'xxx dump'. I really admire the job, Sven, Peter and others have done to improve this stuff. Let's give it a final touch ... regards /andrej