From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11220 invoked from network); 24 Mar 1999 11:51:01 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 24 Mar 1999 11:51:01 -0000 Received: (qmail 17463 invoked by alias); 24 Mar 1999 11:50:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5923 Received: (qmail 17456 invoked from network); 24 Mar 1999 11:50:25 -0000 From: "Andrej Borsenkow" To: "ZSH workers mailing list" Subject: Completion widgets, bindkey and ZLE widgets Date: Wed, 24 Mar 1999 14:49:34 +0300 Message-ID: <001f01be75ec$62b12220$21c9ca95@mowp.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Importance: Normal Currently we have to use bindkey to activate completion widgets. I understand, that it was the simplest way in the beginning (and safest, must I add :-) Unfortunately it means, that you must select your keymap before loading completion and only one keymap is modified. This is particulary annoying, when you change keymap after that. I was very confused by the fact, that I have EDITOR=vim and bidkey -e by default; this results in selecting vi mode with zsh -f - and after I switched to emacs, all new completion was lost. And if on-the-fly keymap switching will be implemented (actually, internally we already have it - between viins and vicmd and from emacs to vi), this may be a real problem. Now, that new completion is already proven fact, why not simply redefine completion widgets? zle -C complete-word complete-word FUNCTION. The original widget is always available (.complete-word) and you can change back in any time. And this will make completion widgets available in any keymap. A step further is to unify normal widgets (zle -N) and completion (zle -C). Consider: widgets are always called using standard interface described in ZLE (with all parameters likes BUFFER, NUMERIC etc set). if this is a completion widget, additional parameters (and arguments) are setup. We still need to designate widget as completion widget in this case, so zle -N won't work - but -C can then be reduced to simple 'zle -C expand-word function'. That will redefine complete-word and mark new widget as completion widget. Looks somewhat cleaner ... and, later, if we find the way to make ZLE widgets more useful, that will be automatically available to completion widgets as well. cheers /andrej