From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4433 invoked by alias); 30 Mar 2015 18:08:25 -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: 34819 Received: (qmail 214 invoked from network); 30 Mar 2015 18:08:23 -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-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=hOmtfhohuh7ZqlkInMLOHC4isKE=; b=jjBezo U0BjXHGCOR865KvzI874pJRs9ThoTQjivcduRWj3RYqAN5gFLkfv1fmjSRmuFwB4 eY9PLhO7HiLRZPar6hHycbLuZNZv5+WVR+/WkMqjfd9x1NlRU2Y9QuIyk5Z6wM5E T+ovKcllgZp9HVAp2y2iqenR4LtIB6r1oZrVU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=hOmtfhohuh7ZqlkInMLOHC4isKE=; b=grTOw pXRVrxfNSUHbUXHxNggq04DgZZnULcQ69jlYA/fBjkTM5dKuP7Gr0NsRDxXvXahT DpvX38CWdDIGiHHVm4SW6ShLrPW0P4k189f30AgL7ykz4SpW9xhAO+QQFKG8oake u7qfrzIu55Nx7x+odV3Ko/WH14aoQarjixPDDc= X-Sasl-enc: ApPe/AHUqL3Osx5LO83PXD+jzPmJG8YfCCaSiLIFNvD6 1427738901 Date: Mon, 30 Mar 2015 18:08:19 +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: <20150330180819.GB3767@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=us-ascii Content-Disposition: inline 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: > torch% alias -g '&&'=AND > torch% echo foo&&bar I suppose there's a project idea here: implement lisp macros for zsh. That is, have some hook (maybe preexec or precmd?) get as argument a list of tokens, and have it return an alternative list of tokens to be executed further. Then the && idea could be implemented as: prefoo() { if (( $#reply )) && [[ $reply[1] == '&&' ]]; then reply=( ';' '()' '{' 'return' '$?' '}' $reply ) fi } Daniel