From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13437 invoked by alias); 27 Mar 2015 16:05:19 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20039 Received: (qmail 8642 invoked from network); 27 Mar 2015 16:05:07 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:to:subject:mime-version :content-type; bh=IaO5SoWHX/oUICepx5coOK9Cr/aIU42PCJrqLUw5Cvs=; b=W8yhBiehwerGG5sE+DSdhtWBSxkqm3/8vaMyH1MNe55dgxzoKD970023iPNvxNuMMX X1bk2lpgAyOiaq1HTYy4EnnEG5HVNT98J2hOTebuoihup7Uu13SSf/rW00c5QPaMZ+F/ V46Qtn0gWbgs09ro5zgvizvP50+MgVLoXkTBpTGxjlOil00yi89ynMiP56BPElMHPtkO xzv/hVH30H4H5zjb04EjdOMpc2w1uK8occZeLDq296SjWLI0v0XXJUmvOJNr5PuSVavy qVYWR8hdZQ8NeNaoqIKQjiaMg4BZt/4xuLO6FDgIcB6D/CWJbMUXZFG8che5xhdc+Ypm zvUg== X-Gm-Message-State: ALoCoQmn/7KjkecknlBa5CFXtDUe05sS7FKf4plFd/6AD1HU/K05+fZpHhhcnp2XJLb4Uc3wKm8f X-Received: by 10.60.146.231 with SMTP id tf7mr2643947oeb.41.1427472304873; Fri, 27 Mar 2015 09:05:04 -0700 (PDT) From: Bart Schaefer Message-Id: <150327090501.ZM4166@torch.brasslantern.com> Date: Fri, 27 Mar 2015 09:05:01 -0700 X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Seeking feedback word breaks and aliasing of tokens MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Following a discussion a few weeks ago, a new feature was added to the "alias" builtin, namely the ability to create aliases for tokens that are part of the basic pipeline syntax. The example that led to this feature was similar to the following: % alias -g '&&'='; (( $? == 0 )) && ' % && print this is OK this is OK % && print and so is this && print also this and so is this also this % This feature has already been adopted, with the restrictions (a) that it applies only to global aliases [-g] and (b) that it is disabled when the POSIX_ALIASES option is set. There is an additional effect of this feature, illustrated by: % alias -g '||'='OR' % print no||yes no ORyes % 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). This also affects the '{' reserved word, so instead of this: % alias '{'=echo % { OK OK % {not OK zsh: command not found: echonot % We would have this: % {now OK now OK % (Note that '{' doesn't require "alias -g" because '{' is a reserved word.) Comments welcome.