From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13987 invoked from network); 10 Mar 2002 16:34:45 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 10 Mar 2002 16:34:45 -0000 Received: (qmail 27405 invoked by alias); 10 Mar 2002 16:34:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16791 Received: (qmail 27394 invoked from network); 10 Mar 2002 16:34:39 -0000 Date: Sun, 10 Mar 2002 16:34:02 +0000 From: Adam Spiers To: zsh workers mailing list Subject: puzzling compset -P behaviour Message-ID: <20020310163402.D6335@corelli.new.ox.ac.uk> Reply-To: Adam Spiers Mail-Followup-To: zsh workers mailing list Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-URL: http://tigerpig.org/ X-OS: RedHat Linux Sender: "Adam Spiers,,07775562717,020 88 30 30 35" $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 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