From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13454 invoked by alias); 30 Mar 2015 18:04:46 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34818 Received: (qmail 15818 invoked from network); 30 Mar 2015 18:04:29 -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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=NFajCgOK5N9z1FCW HW4O0X3kcsI=; b=Mew/ng5vorxw55wsj/2rTqW++QepUcj8pipljXRqjDTzDOZK rPDwjtowoVYRMr5P39U0TsWecoD3dz8ttg//rmOecs7/2yhzSJSE347ZQPoXWItW gOe0p4mlM87M1xTsI8JtfLv2kPvi7t8OW5wVogh2Ob0i9WWTyhhA+gzLzQ8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=NFajCgOK5N9z1FC WHW4O0X3kcsI=; b=skg1tOFuj/kPunmo5NCVJF0etyNZmY2ion2t8uxrDvSKVCn TCJ5BV9OQDKrxz3UdWWfVn39LBGQK7chbt0q3O1wxh+VTaoZD1AcNaok6dvv1R9h eIrnDU2gMs75HbIcom388G0dsst56WelI0IaMgLQ+mhcbIE5nwE5EJLOO5wI= X-Sasl-enc: f59mJSZ8b2VBqw8ozpQiiLjwtZPsEOoPvwg0r5jP+8Gz 1427738662 Date: Mon, 30 Mar 2015 18:04:14 +0000 From: Daniel Shahaf To: Bart Schaefer Cc: Zsh Hackers' List Subject: Re: Word breaks around aliased tokens (was Re: PATCH: Removing aliases from history, 2015 style (was capturing output of !! not working)) Message-ID: <20150330180414.GA3767@tarsus.local2> References: <20150319125351.1e270c2d@pwslap01u.europe.root.pri> <20150320105703.2754b6af@pwslap01u.europe.root.pri> <150320090420.ZM21908@torch.brasslantern.com> <20150322183556.1fa0f143@ntlworld.com> <150322162235.ZM1728@torch.brasslantern.com> <20150323213426.21fd79c8@ntlworld.com> <20150325154853.7efc21d0@pwslap01u.europe.root.pri> <150325124032.ZM32185@torch.brasslantern.com> <150325204305.ZM1653@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <150325204305.ZM1653@torch.brasslantern.com> User-Agent: Mutt/1.5.21 (2010-09-15) Bart Schaefer wrote on Wed, Mar 25, 2015 at 20:43:05 -0700: > On Mar 25, 12:40pm, Bart Schaefer wrote: > } > } torch% echo foo&&bar > } foo foobar > } > } If this were going to change, I would recommend using something akin to > } my patch from workers/34738 to add the second space, rather than attempt > } to remove the first one. > > That would be as below, which is almost identical to 34738 (the salient > difference being use of INP_ALIAS instead of INP_CONT). > > I think this makes sense[*]: > > torch% alias -g '&&'=AND > torch% echo foo&&bar > foo AND bar > > (the pre-patch output is "foo ANDbar") but I will wait for feedback before > pushing. > Agreed: "foo AND bar" makes more sense than either "foo ANDbar" or "fooAND bar". I'm not sure whether the following option is defensible: % echo foo&&bar fooANDbar % echo foo && bar foo AND bar > [*] To the extent I think aliasing these tokens makes sense at all. I'm not sure it's a good idea either. The only use-case I recall seeing is the one of using '% && baz' interactively, and I don't find it compelling, since there are numerous other ways to approach that problem without controversial C code changes. After all, no other language allows changing the syntax at runtime.¹ Cheers, Daniel ¹ Well, TeX does, but I'm not aware of anyone using it this way.