From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2164 invoked from network); 23 Jun 2020 22:55:06 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 23 Jun 2020 22:55:06 -0000 Received: (qmail 4565 invoked by alias); 23 Jun 2020 22:54:55 -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: List-Unsubscribe: Sender: zsh-users@zsh.org X-Seq: 24951 Received: (qmail 7834 invoked by uid 1010); 23 Jun 2020 22:54:55 -0000 X-Qmail-Scanner-Diagnostics: from out5-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25850. spamassassin: 3.4.4. Clear:RC:0(66.111.4.29):SA:0(-2.6/5.0):. Processed in 5.95372 secs); 23 Jun 2020 22:54:55 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudekiedgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfgjfhfogggtgfesthhqtddtredtjeenucfhrhhomhepffgrnhhi vghlucfuhhgrhhgrfhcuoegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvgeqne cuggftrfgrthhtvghrnhephfdtteefheevuedthedutdeifeegteettdejtdffheduieei jeelteetkeduteehnecukfhppeejledrudejiedrfeelrdeileenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegurghnihgvlhdrshhh rghhrghfrdhnrghmvg X-ME-Proxy: Date: Tue, 23 Jun 2020 22:54:09 +0000 From: Daniel Shahaf To: Perry Smith Cc: Zsh Users Subject: Re: Alias call in function fails... Message-ID: <20200623225409.0380caad@tarpaulin.shahaf.local2> In-Reply-To: <0DAEBDBF-F680-4BE8-BF63-AEE98236F631@easesoftware.com> References: <20200623120429.2c889b67@tarpaulin.shahaf.local2> <2982509.CQOukoFCf9@nbkamil> <0DAEBDBF-F680-4BE8-BF63-AEE98236F631@easesoftware.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Perry Smith wrote on Tue, 23 Jun 2020 16:14 -0500: > > On Jun 23, 2020, at 11:03 AM, Bart Schaefer > wrote: > >=20 > > The other thing is make replacements in contexts other than the > > "command position" (global aliases). =20 >=20 > I=E2=80=99d really appreciate if you could give a few examples of this. >=20 [[[ diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index ada69c99a..bff5c4a18 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -105,7 +105,16 @@ For each var(name) with a corresponding var(value), de= fine an alias with that value. A trailing space in var(value) causes the next word to be checked for alias expansion. If the tt(-g) flag is present, define a global alias; global aliases are expanded even if they do not -occur in command position. +occur in command position: + +example(% print -rC1 foo bar ANNOTATE +foo +bar +ANNOTATE +% alias -g ANNOTATE=3D'| nl -ba' +% print -rC1 foo bar ANNOTATE + 1 foo + 2 bar) =20 If the tt(-s) flag is present, define a suffix alias: if the command word on a command line is in the form `var(text)tt(.)var(name)', where ]]] Is this sufficiently clear to be committed? There's already a noderef(Aliasing) a few paragraphs below, which explains how aliases are expanded before almost all other parsing (which is why the =C2=AB|=C2= =BB on the RHS works), but it's perhaps not self-explanatory that nl(1) is an external command.