From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id MAA10397 for ; Mon, 15 Jul 1996 12:46:53 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id WAA06048; Sun, 14 Jul 1996 22:32:00 -0400 (EDT) Resent-Date: Sun, 14 Jul 1996 22:32:00 -0400 (EDT) From: "Bart Schaefer" Message-Id: <960714193241.ZM1933@candle.brasslantern.com> Date: Sun, 14 Jul 1996 19:32:39 -0700 In-Reply-To: Zoltan Hidvegi "Re: Another patch to compctl-examples CVS compctl, and a bug?" (Jul 15, 3:02am) References: <199607150102.DAA03226@turan.elte.hu> Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.702 02jul96) To: Zoltan Hidvegi Subject: Re: Another patch to compctl-examples CVS compctl, and a bug? Cc: zsh-workers@math.gatech.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"S5Qzq3.0.NU1.VsQwn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1644 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jul 15, 3:02am, Zoltan Hidvegi wrote: } Subject: Re: Another patch to compctl-examples CVS compctl, and a bug? } } > "${${${(f@)$({<${pref}CVS/Entries} 2>/dev/null)}#/}%%/*}" } } There are two problems with that. First I've modified the lexer so that } !, [[, { and } are reserved words now. This means that these must be } delimited. So {echo} no longer works, { echo } should be used instead. } Similarily [[-z $foo]] does not work, [[ -z $foo ]] should be used. Hmm. I don't think anything else I've done depends on that, but given that we're already at 3.0-preN for N >1, it seems a rather bad time to make the change. } The other problem is that this depends on READNULLCMD being cat. It depends on READNULLCMD being something that knows when its output is not a terminal, at least; "less" and "more" both work just as well as "cat". } $(<...) always works since it is always recognized as a special command } substitution. That's why the 2> redirection does not work in that case Still seems like a bug to me. } > If there's a better way than `for f in ... do echo ... done' to prefix } > every element of the resulting array with ${pref}, I'd love to see it. } } It's simply } } "${pref}${^${${(f@)$({<${pref}CVS/Entries} 2>/dev/null)}#/}%%/*}" I thought something like that should work, but I never tried the carat in that particular spot. } > works fine. However, if no CVS directory exists at all, the above } > subsitution prints a newline to the terminal -- which messes up zle. } } Are you sure that there is not empty element in the reply? Why should that make a difference? It still shouldn't output a newline. } The above `parameter expansion' always produces at least one element. Here's the behavior I see in a directory that has no CVS subdirectory: If I replace my `for ... echo' loop with your ${^...} solution above, then *every* time I hit TAB I get a newline on the terminal, and I never see any completions. (Your solution works normally in a dir that *does* have a CVS subdir.) If I use my `for ... echo' loop, I get a newline the first time I hit TAB. The second time I hit TAB I get the leading hyphen from the -k array of option letters, followed by a newline, followed by `A' (the first option letter). From that point on I get no stray newlines, and the options cycle normally (though zle is confused if I don't do a at some point. If I use your solution with an explicit "cat", I don't get any newlines, but I also don't get any completions -- not even the -k ones. If I switch back to an explicit "cat" and use my original `for' loop, everything works exactly as I would expect -- no stray newlines at all, and all the expected -k completions appear. So it has something to do with READNULLCMD, and there's something else broken about your solution. (Maybe that's where the empty element in the array is involved?) -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.nbn.com/people/lantern New male in /home/schaefer: >N 2 Justin William Schaefer Sat May 11 03:43 53/4040 "Happy Birthday"