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=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26609 invoked from network); 21 Jul 2022 02:13:12 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Jul 2022 02:13:12 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1658369592; b=PGwtQrJZgPLkJ5grt2egD+is9P1geUjis9Clrv5W/Mnxu7RsYtS35P+r7qy+/hChKfY1DGF2wU qTvQ7LikJiWQL6e8ujEvyELOR6UE5LliQDAEvwR2ct8OWZgQkMOlxxGNTzliGu5Rz2WlGiTTBm BdSEhEN6JZVkkkJcHTX5BWYcMdSYrm09A9RRSRWjhFOVRRFS+kofvRslguK1eGRsjnWpUyOfK1 LsQ4TB/yNXbvyhHGk5GALdvIV9ijIVn+8rZGNQ/+EgQ4khM4lbY5Metek4b/mC8w9AGbVwhAIA Iaw4QDY/sr9ZKfBUAG7qVUpWZrA7bU9bI4SQm4tgFcZ7Ww==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (wout1-smtp.messagingengine.com) smtp.remote-ip=64.147.123.24; dkim=pass header.d=ajrh.net header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=none header.from=ajrh.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1658369592; bh=BYFp1JTUlH+sTaeX9e+w9DaLnWf1zN8Cy0EzlvCTB/I=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Subject:To:From:Date: References:In-Reply-To:Message-ID:MIME-Version:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=B52N6virGKZdszN2M5Jdt/jBolGJrUxyJ7aOm15A5ro4OhkASlaRmzIHK6KMg6zD1nt9ozTYtV frNi00j71psOSne+pp2QP+dtKvqwHadZDtA1kfUJMcBu2YdPZzXhCHAZiSOpIzhEY7wqaTSAm4 M1940mFxWhjtcWboxQBQD++jUrRfvkwES8gaqIJK99gGhOdHZoxFg7EXEPIWOVAyHXMupT8Zym ckrblCuZjL5JmMp3jriol3pAPBbP7AIbez0EwzcSFbt+/Q/jb0Q+1lj4rw5YfiPcgJuaUwk4Ko mASVJ8/4SCc/0tT5/qn5P0CUHOZDp+AeZHiVl1OTbpaoCw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Subject:To:From:Date:References:In-Reply-To:Message-Id: Mime-Version:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=GzsSoKJUB7i+BLHDVNlDowMndB8ZTXsMm3tpgQNceUs=; b=kVUvCFDDuaH5tO0PeswQckbWDH Ku1VHukJnLWsYXUPmhNc7VDxdHInMfUFwTvKAZFWiH9FoldAQmU9RyQJPj7IEnlG/JnEPfp7Esu+z ZkFr8BhzYjXXko7hNKG3+0uFluPPjdjIASS2n38zMzKJJXhHdbJnN2UrG6pG1IfJ3qpOQOkq70sC9 gyQAA2XTQ0tF9cWX7/dUtKBm+rr0l3Mpkuz6D3/wMJtuXQYVEWDs5PXV690gaWw1NWDdqxoeSBBr7 KCDDbr+aK0Oj4wodNKr/UkdB2gcdkBiQ0TwAfk0wyA3XLcv1Z24koMtn+EyO+sm+1bIxkjfD3o2qW FDQoT8Qw==; Received: from authenticated user by zero.zsh.org with local id 1oELgd-000DEU-Jy; Thu, 21 Jul 2022 02:13:11 +0000 Authentication-Results: zsh.org; iprev=pass (wout1-smtp.messagingengine.com) smtp.remote-ip=64.147.123.24; dkim=pass header.d=ajrh.net header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=none header.from=ajrh.net; arc=none Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:39167) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1oELfc-000CUa-OE; Thu, 21 Jul 2022 02:12:10 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 9A72632000E5 for ; Wed, 20 Jul 2022 22:12:06 -0400 (EDT) Received: from imap49 ([10.202.2.99]) by compute3.internal (MEProxy); Wed, 20 Jul 2022 22:12:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ajrh.net; h=cc :content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1658369526; x= 1658455926; bh=GzsSoKJUB7i+BLHDVNlDowMndB8ZTXsMm3tpgQNceUs=; b=b OM/hPC5Fjc3ZsOn3sU44y/tXdpGY9EAom4YQyqbu7k/+H3dS6TL/iRYeeBasFq56 KU0RMo9IYmFQgqMyDITu62x4ZHjXuc9Hv8rp+wfo6DSyhyvuoPTgF3vS0vRBuqNn fZpafvLQeIJbXCE2tn8VYRxnejb9MsQPvzX59mls56Y6UaoaNz24WMHDBDsgscBG a4N2RtduELIzNlMecgHBVYtaAtVK6DNNm1BtDzEbn/OKr7KzODfUnrdui5YamsYQ vkCmtjCA36gXJR47YoF6NHIG4h6/ZMvzWYt6Z91V7wxa9iGygHmwtEaiVwHCedId 2L6osvH8frYgho1TF9nDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1658369526; x=1658455926; bh=G zsSoKJUB7i+BLHDVNlDowMndB8ZTXsMm3tpgQNceUs=; b=fPDIiV6yHocZe5eKv eKGIJDPL2oDzhuDy9z10EYzK9JWxJF59SX1AJr3lqGPJF1TW32sI14mOLiWMuutQ U6KQtyWvrYnYtIWHTLPl4CcZBYw04e/B8sWesKtmo6sX1Z095zWFI9jSacO9pAS2 HwSJPDmI3FxusZDi7I5QBr+U071eE1Bxviz1TfL9+vErvXCTqenBs+R6cSXY2Uen EAY8yu/ZKPAVmkZQXg8tCcCbaVRi0FD+YERoRz7FiQCPfIH1/Y0sUct+Ob5lBoSU SQrfYtjuHDtF5f0vy7cKO6sQM1pMJwT4Ekl5vV8oCxwGuAGHoq4ismrt4cp8n/4U lvF9w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudelfedgfedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtgfesth hqredtreerjeenucfhrhhomhepfdetnhhthhhonhihucfjvggrughinhhgfdcuoegrjhhr hhesrghjrhhhrdhnvghtqeenucggtffrrghtthgvrhhnpeegtdfhffehueekgefhhfefje ffgffgieffiefggeegfefgieettdeiteejhfdtueenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpegrjhhrhhesrghjrhhhrdhnvght X-ME-Proxy: Feedback-ID: i6aa94791:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id E225215A0087; Wed, 20 Jul 2022 22:12:05 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-755-g3e1da8b93f-fm-20220708.002-g3e1da8b9 Mime-Version: 1.0 Message-Id: <9310fc4a-8db9-48d8-873b-c50a63f9aea5@www.fastmail.com> In-Reply-To: <645ba344-9d97-4ddf-82c6-e6338c98da8b@www.fastmail.com> References: <28c00da7-cfdd-4f58-a539-8deebbe5dfa5@www.fastmail.com> <645ba344-9d97-4ddf-82c6-e6338c98da8b@www.fastmail.com> Date: Wed, 20 Jul 2022 22:11:45 -0400 From: "Anthony Heading" To: zsh-users@zsh.org Subject: Re: view onto command pipeline? Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Seq: 27912 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Wed, Jul 20, 2022, at 9:35 PM, Lawrence Vel=C3=A1zquez wrote: > On Wed, Jul 20, 2022, at 8:15 PM, Anthony Heading wrote: >> Agree >> quoting $@ makes sense here since this is a wrapper, but I find more=20 >> often dropping empty >> arguments is often very helpful after splits and suchlike. >> >> But as to "${opts[@]}"... Just too ugly to do that all the time, no= ? =20 >> Instead, use >> zsh's awesome sticky emulation:=20 >> >> emulate zsh -c 'autoload -Uz ~/my-zsh-funcs/*' > > Leaving $opts[@] unquoted still elides empty elements in this > context; that behavior is not limited to $@. (If this is what you > actually want, go for it. Just don't think that fiddling with > options has an effect.) > Yes indeed! Though recall the context here was a *fixed* *literal* arra= y: opts=3D(-c color.ui=3Dalways) command git $opts "$@" Quoting "$@" agreed, but writing "${opts[@]}" instead here seems a little bit like self-flagellation, no? > It's better to run ''emulate -L zsh'' inside the function itself > (or localize and [un]set options individually as desired) to achieve > a known state, rather than relying on a specific method of invocation. Oh, interesting! why is that? Certainly want to get the most stable state. I do vaguely remember tricky corner cases being discussed on zsh-workers maybe decades ago, but it seems to work great now. And, unless I picked up this autoload idiom from the mailing list, I think it's from the man pages somewhere. If you're advising that it's sub-optimal, should it be removed or caveated in the documentation?