From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13464 invoked from network); 23 Jul 1999 08:57:18 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 23 Jul 1999 08:57:18 -0000 Received: (qmail 14841 invoked by alias); 23 Jul 1999 08:57:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7259 Received: (qmail 14834 invoked from network); 23 Jul 1999 08:57:08 -0000 Date: Fri, 23 Jul 1999 10:57:06 +0200 (MET DST) Message-Id: <199907230857.KAA05005@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Peter Stephenson's message of Fri, 23 Jul 1999 09:58:50 +0200 Subject: Re: PATCH: 3.1.6-test-2: _parameters Peter Stephenson wrote: > This tidies up _parameters a bit. I'd have liked to use something like > > if zmodload -e parameter; then > compadd "$@" - ${(k)parameters} > return > fi > > but then there's no way of getting rid of local parameters, which is a > shame. Huh. This was probably pure oversight. The patch below adds `-local' for local parameters for $parameters and ${(t)foo}. Then it changes _parameters. And then it changes _normal -- I was planning to do this anyway. Bye Sven diff -u os/subst.c Src/subst.c --- os/subst.c Tue Jul 20 08:54:13 1999 +++ Src/subst.c Fri Jul 23 10:38:38 1999 @@ -1031,6 +1031,8 @@ case PM_HASHED: val = "association"; break; } val = dupstring(val); + if (v->pm->level) + val = dyncat(val, "-local"); if (f & PM_LEFT) val = dyncat(val, "-left"); if (f & PM_RIGHT_B) --- os/Module/parameter.c Fri Jul 23 10:53:32 1999 +++ Src/Modules/parameter.c Fri Jul 23 10:53:48 1999 @@ -91,6 +91,8 @@ } DPUTS(!val, "BUG: type not handled in parameter"); val = dupstring(val); + if (pm->level) + val = dyncat(val, "-local"); if (f & PM_LEFT) val = dyncat(val, "-left"); if (f & PM_RIGHT_B) diff -u od/Zsh/expn.yo Doc/Zsh/expn.yo --- od/Zsh/expn.yo Fri Jul 23 08:28:53 1999 +++ Doc/Zsh/expn.yo Fri Jul 23 10:39:36 1999 @@ -647,6 +647,9 @@ detail: startitem() +item(tt(local))( +for local parameters +) item(tt(left))( for left justified parameters ) diff -u oc/Core/_normal Completion/Core/_normal --- oc/Core/_normal Wed Jul 21 13:28:21 1999 +++ Completion/Core/_normal Fri Jul 23 10:51:13 1999 @@ -20,7 +20,11 @@ cmd2="${command:t}" else cmd1="$command" - cmd2=$(whence -p $command) + if zmodload -e parameter; then + cmd2="$commands[$command]" + else + cmd2=$(whence -p $command) + fi fi # See if there are any matching pattern completions. diff -u oc/Core/_parameters Completion/Core/_parameters --- oc/Core/_parameters Fri Jul 23 10:40:26 1999 +++ Completion/Core/_parameters Fri Jul 23 10:45:22 1999 @@ -4,4 +4,8 @@ # extra options of compadd. It completes only non-local parameters. All # arguments are given to compadd. -compadd "$@" - ${${${(f)"$(typeset +)"}:#*local *}##* } +if zmodload -e parameter; then + compadd "$@" - ${(k)parameters[(R)^*local*]} +else + compadd "$@" - ${${${(f)"$(typeset +)"}:#*local *}##* } +fi -- Sven Wischnowsky wischnow@informatik.hu-berlin.de