From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3240 invoked from network); 3 Jul 1997 10:56:45 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 3 Jul 1997 10:56:45 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id GAA23844; Thu, 3 Jul 1997 06:43:58 -0400 (EDT) Resent-Date: Thu, 3 Jul 1997 06:43:58 -0400 (EDT) Date: Thu, 3 Jul 1997 14:48:31 +0400 (MSD) From: Andrej Borsenkow X-Sender: bor@itsrm1 Reply-To: borsenkow.msk@sni.de To: Zsh workers mailing list Subject: Suggestion for completion interface Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"YYf_T2.0.Vq5.j9ukp"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3346 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Currently coompletion is tightly coupled with several ZLE widgets; it is impossible to use completion is user-defined widgets, also it impossible to add extensions to completion (notorious colour-ls patch). May be, it possible to slightly change interface. The idea is: completion should just build a list of possible choices. It can return it e.g. in define ZSH variable, let's say COMPLETION_RESULT ZLE should provide widget(s), which just takes as argument given list of choices and implement usual list/menu selection (well, it is no more completion) then current widgets, like complete-word, list-choices etc can be redefined in terms of call to completion followed by call to selection widget. hard part is providing hooks to user-extensions. One possibility is, that selection widgets operate on two arrays - one with actual choices and other with "user visible" ones. It will make colour patch really simple. All the above has probably some advantages: 1. there were several requests about calling completion from user functions. The above changes make it at least possible to call coompletion in widgets (were input is clear defined). 2. It makes it possible to create custom completion widgets. Currently I have to define completion for _every_ command I use. With suggested changes it would be possible to create widget zle-select-user with contents like ZLE_CHOICES=("${(@)${(f@)$(