From: Adam Spiers <adam@spiers.net>
To: zsh workers mailing list <zsh-workers@sunsite.auc.dk>
Subject: puzzling compset -P behaviour
Date: Sun, 10 Mar 2002 16:34:02 +0000 [thread overview]
Message-ID: <20020310163402.D6335@corelli.new.ox.ac.uk> (raw)
$PREFIX and $IPREFIX seem to get "reset" with nested calls to
compset -P. For example:
% _foo () {
echo "\nfoo IPREFIX[$IPREFIX] PREFIX[$PREFIX]"
compset -P '*1'
echo "foo IPREFIX[$IPREFIX] PREFIX[$PREFIX]"
}
% _foo2 () {
_foo
echo "foo2 IPREFIX[$IPREFIX] PREFIX[$PREFIX]"
compset -P '*2'
echo "foo2 IPREFIX[$IPREFIX] PREFIX[$PREFIX]"
}
% compdef _foo2 foo
% foo ab1cd2e<TAB>
foo IPREFIX[] PREFIX[ab1cd2e]
foo IPREFIX[ab1] PREFIX[cd2e]
foo2 IPREFIX[] PREFIX[ab1cd2e]
foo2 IPREFIX[ab1cd2] PREFIX[e]
whereas I would have expected:
foo IPREFIX[] PREFIX[ab1cd2e]
foo IPREFIX[ab1] PREFIX[cd2e]
foo2 IPREFIX[ab1] PREFIX[cd2e]
foo2 IPREFIX[ab1cd2] PREFIX[e]
and the latter would make my life considerably easier with a set of
functions I'm writing for completing the 'larch' command.
[ Incidentally, if you haven't seen it, arch is a beautifully designed
version control system which not only learns from all the mistakes CVS
and other VC systems made, but adds plenty of very desirable features
no other system has, including extremely powerful automated tools for
merging between branches. Homepage at: http://www.regexps.com/#arch ]
--
Adam Spiers -=- musician & hacker -- adam@spiers.net -=- http://tigerpig.org/
$_=q{*{$Just =bless{},'$another ';"\$Perl \::$Hacker"}=sub{print$%[$.++];$,,$
;$_[0]},eval join+v45.62,('$z')x6};s/(?<=\$)([a-z\n]+ ?)/push@%,$+;f/egi;eval
next reply other threads:[~2002-03-10 16:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-10 16:34 Adam Spiers [this message]
2002-03-10 16:41 ` Bart Schaefer
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=20020310163402.D6335@corelli.new.ox.ac.uk \
--to=adam@spiers.net \
--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).