zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk, 517008@bugs.debian.org
Subject: Re: Bug#517008: alias not expanded with zsh -c
Date: Wed, 25 Mar 2009 18:20:05 +0000	[thread overview]
Message-ID: <200903251820.n2PIK6JI016478@news01.csr.com> (raw)
In-Reply-To: <090325111130.ZM7836@torch.brasslantern.com>

Bart Schaefer wrote:
> } Is the fix as simple as the following?  This is not a trick question, I
> } could very easily have missed something.
> 
> Will this cover "emulate -c"?

If you mean cover it in the sense that the option is turned on before
any code is parsed---yes, but that's not changed by this patch.  It
won't cover the case where emulate -c is followed by multiple lines of
code that define aliases that are expected to be available in following
lines.  I'm not sure it needs to: there's no question of that being
standardised and we are at liberty to define the rule as being what it
is by default, i.e. code is parsed and aliases expanded before any code
is executed; although I can see you might expect it to be the same
as the shell's own -c option.

> I'm a bit leery of even starting down this road, because it still fails
> to make any difference if the alias definition and use are on the same
> line (separated with ";" or "&&" etc.).

I think it's accepted that this will not work with any current shell
implementation, not just zsh.

But yes, I share your feeling that this isn't a particularly vital
addition, it just looked easy to do like other shells in compatability
mode, which is the point of that.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


  reply	other threads:[~2009-03-25 18:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090225022850.GA4841@vin.lip.ens-lyon.fr>
2009-03-25 14:54 ` Clint Adams
2009-03-25 16:30   ` Peter Stephenson
2009-03-25 17:25     ` Peter Stephenson
2009-03-25 18:11       ` Bart Schaefer
2009-03-25 18:20         ` Peter Stephenson [this message]
2009-03-26  0:14           ` Bart Schaefer
2009-03-26  9:50             ` Peter Stephenson
2009-03-26 15:12               ` Bart Schaefer
2009-03-26 15:18                 ` Peter Stephenson
2009-03-25 23:35         ` Vincent Lefevre

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=200903251820.n2PIK6JI016478@news01.csr.com \
    --to=pws@csr.com \
    --cc=517008@bugs.debian.org \
    --cc=zsh-workers@sunsite.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).