From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17531 invoked by alias); 15 May 2015 00:47:54 -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: 20216 Received: (qmail 17815 invoked from network); 15 May 2015 00:47:51 -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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1431650462; bh=3CMtRVZsy3I61i/z1FasIgLAWfzr08BTFWAFLjMsdH8=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=D9cZKrj0nTQ2n2pnBO7sVlBfYsxUDyfrMYF7BY4BnlfZLYh+VBB9yUHRyvA/CycbfVn8lcnuMF6J4R31nG8pHCEicjRvGpJuZ2Lq7yshmqRsfkln5FxT3iBcumMcIPXWq+wDG/GtUlvuFaedcNh2mEJDz80fCBiCvv8pT+4kNUbzNaY+ew9HeVTSNaUKZODHbmuQ5sUst4Ao+u5+E8CyxGtzg2/tcuz/zYM/QAvbqb3Xxjh/oDkuF6GZKt+SSuVpoLE67ZtOe0kUzeT/9mTTHZD/vU0Czl13a3XiktMFaRMfJiHyDtAAi42/QIv4C8xcdWQBg9HnvKApfXisnpvL4w== X-Yahoo-Newman-Id: 59136.41530.bm@smtp141.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Lla4fGcVM1keB7jn3jxRKNkfXFIK38i.j.Cw8zJ8oT1iTjS x61xvRc.Lg5GKWSPbhT0A8JjXxMBIzzfr95wo5ORBY.ty0soby_LEY2g51qo r5idbS3S9p0eVvhs6vT9CoVjlLVZUTvmG0s5B_.nm6Pvl5OKxc4EWrLPiiOa _cihK1MijPdCf0TM1SuChY0hXLmqiv4N0DAvJw9lm42e2C.HfhbskhztP3PD b_5key65dRz1R8rKgx_cUGI0pQ6WY8j8Njdx_9mbXnwwGwO.KL_linplCiRI h4HhE4EbO6T7YAWyRsMbteXcEKEy.3j9Sk6V40z_Yf4DZPVUvVEEh95.jHEd VQN78zQnZHltJL0G7ZdRIwFpF9mZBvbV.lPqTE6FMFwl8ydqDhUKDvcv0vKd HME3l_SBln0ZrSGIZM1afE9Zz0t8E_iG95MwH_uwlPzmsKCY5O2mpBMsZGVk W2q92JumgDVJbfyBFm8gHwNXwRR8e1bNHarI9zzYjxda.31xI_HucM1Z316m iDH8xGiLmllCv0XfrTiiEER_D89c04Mi. X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <150327090501.ZM4166@torch.brasslantern.com> From: Oliver Kiddle References: <150327090501.ZM4166@torch.brasslantern.com> To: zsh-users@zsh.org Subject: Re: Seeking feedback word breaks and aliasing of tokens MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27691.1431650460.1@thecus.kiddle.eu> Date: Fri, 15 May 2015 02:41:00 +0200 Message-ID: <27692.1431650460@thecus.kiddle.eu> On 27 Mar, Bart wrote: > "alias" builtin, namely the ability to create aliases for tokens that > are part of the basic pipeline syntax. > 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). The added word breaks do remove flexibility because you could always have included them in the alias: alias -g '||'=' OR ' One possible use might be to disable ||, perhaps for a restricted shell such as with alias -g '||'='\|\|' in that case you wouldn't want the added spaces. 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 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 You can't alias something like 2>&1 though. alias -g '&'='&!' doesn't have the same problem and I could see someone finding that useful. Oliver