zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: Seeking feedback word breaks and aliasing of tokens
Date: Thu, 14 May 2015 18:35:02 -0700	[thread overview]
Message-ID: <150514183502.ZM31123@torch.brasslantern.com> (raw)
In-Reply-To: <27692.1431650460@thecus.kiddle.eu>

On May 15,  2:41am, Oliver Kiddle wrote:
} Subject: Re: Seeking feedback word breaks and aliasing of tokens
}
} > Note that a word break is introduced to the left of the expansion (because
} > of '||'s original meaning as shell syntax) even though there are no spaces
} > around the original usage; but no word break occurs to the right of the
} > expansion.  The proposal is for word breaks on both sides of the expansion
} > (as is implied by recognition of a separately aliasable word).
} 
} I'd agree that 34781 made sense in that having the word break on only
} one side of the token after alias expansion is not consistent. Was the
} preceding word break always there or intentional as part of the recent
} changes?

It was always there, and nearly impossible to remove without completely
rewriting the parser, as far as I can tell.

} The added word breaks do remove flexibility because you could always
} have included them in the alias: alias -g '||'=' OR '

That introduces a different problem because an alias that explicitly ends
with a space triggers alias expansion on the following word.

} It seems redirections are also covered by this change but this looks
} like a bug:
} % alias -g '>!'='REDIR'
} % echo one>!two
} zsh: event not found: two
}  prompt.c:1539: BUG: cmdstack empty

That has nothing to do with the alias, it's a completely different bug.

schaefer[619] Src/zsh -f
torch% echo one>!two
zsh: event not found: two
../../zsh-5.0/Src/prompt.c:1539: BUG: cmdstack empty

} You can't alias something like 2>&1 though.

Correct, because that's three tokens "2" ">&" "1" and every alias has to
be for a single token.


      reply	other threads:[~2015-05-15  1:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27 16:05 Bart Schaefer
2015-03-28 23:58 ` Eric Cook
2015-03-29  4:19   ` Bart Schaefer
2015-03-29  4:47     ` Bart Schaefer
2015-03-29 17:09     ` Eric Cook
2015-03-29 21:02       ` Bart Schaefer
2015-05-15  0:41 ` Oliver Kiddle
2015-05-15  1:35   ` Bart Schaefer [this message]

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=150514183502.ZM31123@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --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).