From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: schaefer@nbn.com
Cc: zsh-workers@math.gatech.edu
Subject: Re: Another patch to compctl-examples CVS compctl, and a bug?
Date: Mon, 15 Jul 1996 03:02:23 +0200 (MET DST) [thread overview]
Message-ID: <199607150102.DAA03226@turan.elte.hu> (raw)
In-Reply-To: <960713173425.ZM5697@candle.brasslantern.com> from Bart Schaefer at "Jul 13, 96 05:34:22 pm"
> It's now possible to avoid several external processes in generating the
> list of CVS-controlled files in the `cvstargets' function. The key is
> this wonderful "parameter" (boy, is that misnamed) subsitution:
>
> "${${${(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.
The other problem is that this depends on READNULLCMD being 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
(but a space between `(' and `<' fixes that problem).
> 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)}#/}%%/*}"
> 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? The above
`parameter expansion' always produces at least one element.
Zoltan
next prev parent reply other threads:[~1996-07-15 1:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-07-14 0:34 Bart Schaefer
1996-07-14 1:55 ` Bart Schaefer
[not found] ` <schaefer>
1996-07-14 2:00 ` Bart Schaefer
1996-07-17 21:52 ` Completion behavior change in 3.0-pre3 Bart Schaefer
1996-07-19 19:53 ` Another patch to compctl-examples CVS compctl, and a bug? Bart Schaefer
1996-07-22 7:34 ` Peter Stephenson
1996-07-22 6:53 ` Bug in case stmt with '(' Bart Schaefer
1996-07-15 1:02 ` Zoltan Hidvegi [this message]
1996-07-15 2:32 ` Another patch to compctl-examples CVS compctl, and a bug? Bart Schaefer
1996-07-15 4:30 ` Zoltan Hidvegi
1996-07-15 7:03 ` Bart Schaefer
1996-07-15 17:02 ` Bart Schaefer
-- strict thread matches above, loose matches on Subject: below --
1996-07-16 6:00 Completion behavior change in 3.0-pre3 Bart Schaefer
1996-07-17 9:52 ` Christoph von Stuckrad
1996-07-17 15:29 ` Bart Schaefer
[not found] <199607191600.SAA08613@bolyai.cs.elte.hu>
[not found] ` <9607211853.ZM979@morgan.com>
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=199607150102.DAA03226@turan.elte.hu \
--to=hzoli@cs.elte.hu \
--cc=schaefer@nbn.com \
--cc=zsh-workers@math.gatech.edu \
/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).