zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: alias not found
Date: Thu, 29 Oct 2015 20:16:31 -0700	[thread overview]
Message-ID: <5632E10F.5050301@eastlink.ca> (raw)
In-Reply-To: <151029165313.ZM18037@torch.brasslantern.com>

On 10/29/2015 04:53 PM, Bart Schaefer wrote:
> On Oct 29,  1:32pm, Ray Andrews wrote:
> }
> }     $ . ./navtools; type naliases; naliases
> }     naliases is an alias for n_aliases
> }     zsh: command not found: naliases
>
> The entire line ". ./navtools; type naliases; naliases" has already
> been parsed into bytecode before any of it is executed.  So when
> navtools creates the alias, it's too late -- naliases has already
> been consumed and is not subject to alias replacement until another
> subsqeuent chunk of input is presented to the parser (effectively,
> not until after the next PS1 prompt is printed).
>
> This is one reason aliases are a bad idea in general.  It would be
> much better if navtools used e.g.
>
>      function naliases { n_aliases "$@" }
>
Ok, that's one of those little things that's easy to get wrong.
I'm thinking of each command being finished and returned before
the next one is even looked at. Is there some fix for that?
Which is to say, can we force sequential execution? It seems this
sort of thing is only a problem with aliases, or at least that
I've seen so far.


  reply	other threads:[~2015-10-30  3:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 20:32 Ray Andrews
2015-10-29 23:53 ` Bart Schaefer
2015-10-30  3:16   ` Ray Andrews [this message]
2015-10-30  4:56     ` Bart Schaefer
2015-10-30  6:00       ` Ray Andrews

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=5632E10F.5050301@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /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).