From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2953 invoked from network); 12 Jun 1999 16:10:17 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 Jun 1999 16:10:17 -0000 Received: (qmail 1965 invoked by alias); 12 Jun 1999 16:09:58 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6602 Received: (qmail 1958 invoked from network); 12 Jun 1999 16:09:56 -0000 Message-Id: <9906121541.AA35258@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Re: WORDCHARS, etc. In-Reply-To: "Sven Wischnowsky"'s message of "Thu, 10 Jun 1999 12:42:44 DFT." <199906101042.MAA23616@beta.informatik.hu-berlin.de> Date: Sat, 12 Jun 1999 17:41:23 +0200 From: Peter Stephenson Sven Wischnowsky wrote: > The more I read about this the more I think that we should just go > ahead and allow all zle widget functions to get (an arbitrary number > of) arguments (strings). If no arguments are given, the function uses > its defaults. We could than probably have a couple of generic > functions (e.g. for word movement) and define aliases to them with > fixed arguments (as Peter suggested with flags), probably even for > some of the functions that are currently real builtin widgets. Just thinking about this again. I've moved the discussion to zsh-workers. - How do we decide whether an argument is going to be a digit argument or a string? (Wayne, how does your patch for `zle widget ' work? It seems to assume it should set the digit argument to 1 if didn't begin with a digit. Is that important? And shouldn't it handle negative numbers?) There's no way of telling whether an arbitrary widget wants a digit or a string; should be add a flag for the latter? - Then we presumably need to add two flags, saying whether the command just expects typed input, like isearches (which will be treated like bindkey -s strings and put into the unget buffer), or whether it actually wants a string argument, like the proposed modifications to the movement commands. If you think it's useful to have more than one argument, then presumably a counter giving the max number of string arguments is more useful than a second flag. Where would more than one argument be useful (apart from specifying a numeric as well as a string argument)? - The extended alias mechanism, if it's a good idea, would presumably allo `zle -A old-widget new-widget args-to-pass-to-old-widget'. Then you can create, for example, an ad hoc isearch command with just a zle -A command without needing to define a function. That would mean adding room for either a char * or a char ** or a LinkList in the thingy struct, though. -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy