From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22596 invoked from network); 9 Jul 1999 13:03:02 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 9 Jul 1999 13:03:02 -0000 Received: (qmail 23409 invoked by alias); 9 Jul 1999 13:02:47 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7076 Received: (qmail 23402 invoked from network); 9 Jul 1999 13:02:46 -0000 Message-Id: <9907091234.AA18577@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: completions for su and implicit fg/bg In-Reply-To: "Sven Wischnowsky"'s message of "Fri, 09 Jul 1999 12:44:54 DFT." <199907091044.MAA16294@beta.informatik.hu-berlin.de> Date: Fri, 09 Jul 1999 14:34:00 +0200 From: Peter Stephenson Sven Wischnowsky wrote: > Peter Stephenson wrote: > > I think the code in _first was deliberately left commented because it gets > > run every time, but the impact of this change is minimal. > > Right. And since we only want it in command position, we should > probably put it in _command_names. Yes, of course that's the right place. This patch moves it there. Also, the obvious way of getting the shell is from $SHELL, so I added that to _su. > It's `compset -q' -- and with that I can repeat the question I asked > at the time when I sent the completion-quoting-patch: currently the > `-q' option only has an effect if the word on the command line is > quoted -- should we change it to work on unquoted strings, too? Presumably the answer should be yes, for consistency. I already gave an example with backslashing where it should be treated that way. > And: nothing against giving _normal (an) optional argument(s) that > will be put at the front of $words. (_normal is one of the older > functions that survived (with changes) the transition from reporting > command line words as positional parameters to the $words array we > have now; that's why nobody made it accept arguments again, I think). Sounds reasonable, but I haven't looked at this. --- Completion/Base/_command_names.cn Tue Apr 13 09:37:36 1999 +++ Completion/Base/_command_names Fri Jul 9 14:27:33 1999 @@ -2,6 +2,13 @@ local nm=$compstate[nmatches] ret=1 + +# Complete jobs in implicit fg and bg +if [[ "$PREFIX[1]" = "%" ]]; then + compgen -j -P '%' + [[ nm -ne compstate[nmatches] ]] && return +fi + compgen -c && ret=0 if [[ nm -eq compstate[nmatches] ]]; then --- Completion/Base/_first.cn Fri Jul 9 12:04:39 1999 +++ Completion/Base/_first Fri Jul 9 14:26:33 1999 @@ -61,8 +61,3 @@ # (( i++ )) # done # fi - -# Complete jobs in implicit fg and bg -if [[ "$CURRENT" = 1 && "$PREFIX[1]" = "%" ]]; then - compgen -j -P '%' -fi --- Completion/User/_su.cn Fri Jul 9 14:28:48 1999 +++ Completion/User/_su Fri Jul 9 14:30:28 1999 @@ -14,7 +14,7 @@ return fi -shell=${"$(egrep "^$usr:" Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy