From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: 3.1.6-test-2: _parameters
Date: Fri, 23 Jul 1999 10:57:06 +0200 (MET DST) [thread overview]
Message-ID: <199907230857.KAA05005@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Peter Stephenson's message of Fri, 23 Jul 1999 09:58:50 +0200
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
next reply other threads:[~1999-07-23 8:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-07-23 8:57 Sven Wischnowsky [this message]
-- strict thread matches above, loose matches on Subject: below --
1999-07-23 9:22 Sven Wischnowsky
1999-07-23 9:18 Sven Wischnowsky
1999-07-23 7:58 Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199907230857.KAA05005@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).