From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 165152725E for ; Tue, 12 Mar 2024 18:55:22 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1710266122; b=AH5EGsNU3kfZuzIBUc5Ly4dTP2bdzCSiz8zwL9N/QMVM2b9G3QvrgGxZaL0oRGw9Kn39juFKjD 9u2bCvTX12Cx9qF1M20/3UdaNnGLKogklGncGPpysqGJ0B1qwZAaYnBzRT2JdlGVPmJq+XsZKM IWksLUx2+uXzQIlQwiAumatYWxhf5aCYkU5vujMfZ1zTIfK3eQ0FLtqCH/h3eK45s2LL2Z0WrH QFuZOSH6NAPGLsTdmVD+kHhALD6NUFofYYDMDRpdspZ7/A/XGuJxtNcyVHKiATOTMOLft27e+g g2aF8sjfxJ4rPY5ptcjef6uGZkBT1L9vz9MTFgCwwSib4A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f48.google.com) smtp.remote-ip=209.85.208.48; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1710266122; bh=sEQZYHbNefy3j/uMV44LhSocsPRrCuH4FgGQp0cIdP4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=VivtPl7taqMOjpd1qHq98/tTwVZMg5vkk+SpuaUikRplM5SazCqsXW9QhKo8viRSmId1Iqp04G sy/RSDczuLBRgPvqy/BTWJq2eQ9HT0zn/Ct55Jyr1DfyWk9r4zzm81clkNf9DU9EDrKrJnbxx2 0O8a4Lxbxe3z14hjA7hu2neUVTjE8cWqOzbbny8iy+QRruKag34YLO/l3aNgdhONfR1sbQKEcg RJC3ShxMobC21kcvY9XMK+silOLJwF1UZM1ClYvzPKRHhpaaD3woU9nYGsFhTtuvqzBhbZdNvP xvTWfUfOW3/I//U81slbmFre+B6h/HoaMrSV1vto3K98Mg==; 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:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=UTBWhhfnI8C5IRjKw69pio8+PhWAORE497tFNxEOVSk=; b=rX69LaQQi2CxPUM+icSOLzS6LU v+YRdLabnVAxwqeqmrcyiUExx4b+5urxda+yc1esnd4q10MQIOYZeP+3xobMJj19k62k+0DVpqZJt ulEMaAPLlMzNhWe39xqboXmnogsZcmiHX3fxbz3jhsCC4KdSVrQ6JObMmKDLI4oOE9l98dKhtgtKE lnRoTZFUWSk6VhWfacse2YsEsKP7v3XnC1k+OysDUo8Fxx74UzPKPh521VoAx6mOVdT5cwY34TLAr JfqN7Dycr649qfAc2uyI8DgGAO69oTinUIcMtQDS7tSXnXrr32puOWoN5e0+5gmH/64daFmbFIMZF bUXz5cMQ==; Received: by zero.zsh.org with local id 1rk6LR-000Onu-09; Tue, 12 Mar 2024 17:55:21 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f48.google.com) smtp.remote-ip=209.85.208.48; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f48.google.com ([209.85.208.48]:53563) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rk6LC-000OWS-D1; Tue, 12 Mar 2024 17:55:07 +0000 Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-56845954fffso4629255a12.3 for ; Tue, 12 Mar 2024 10:55:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1710266105; x=1710870905; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=UTBWhhfnI8C5IRjKw69pio8+PhWAORE497tFNxEOVSk=; b=OmXnaA75WLl8vQqQik2MJaNb2WA1QCrrcOlkHoVsgVicUUe1MzH+qfnXmwSyh22dEL egZPmMtjEVU4Kcq/3l7lxH6/PI+klwdCeLe4u6utoET3Uo11pvJVREG4dHrff8Z1Vgpy kEOGdh7Gtlu2bESdLBpGv8le8j/4edpINQuXbQuBcQ3WEFZA0Hr2/l1ytzlYW/Q980Ld 0J72UeC7xupHgrcMX42zmItigoHBm+twT72GYUqJ7PDxtrEAQAAG78aj/1B74XKcwZBh BvU7OK/yA7dcN2Q0KZD14qGfEBqS+8kDNqzssNoW/F8tyw/5mAUQ94G/2mKYoiAymgB9 V9BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710266105; x=1710870905; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UTBWhhfnI8C5IRjKw69pio8+PhWAORE497tFNxEOVSk=; b=gbsN29B5c/paCddjeYpCT/OQ1NLlkxdbtWhrzk+3rHlvHF2E+EsHEA2eI5qupsqDE8 WIGuTW+c3dzNadjMxwY/dJFHs94Ks07Tz/3shMiJFlib33MOL3hcW8Hy0Hvq7cZ74c4z 0ZHpptyJ46SJlzb0QLcSWVMFX0HMGqBppsdkK56ddWTgp4up4qX2TLETBXbTedzissIC d+ORUIuUthMvhPSnk9yilq96/Dstm9CMcVz2b0otzaeM1aOmIsUs4iRUQC5UkHq1NgQu RZKpNH7ewH1ftNfL16dzgl1g80JDdEKBr0h3WIMCmjvbKzQXKy9zKQtm6KD4gJl7eRge XY3g== X-Gm-Message-State: AOJu0YzQdgdk0usngz2/6CyyrhqOLTH+u7O6JWxneJjAAVOKBVv1uD7F p2gD9MRnl5FexnJGqkbECyo8Up0tPkXDConRIzD6iQ4gqYnTf1tltmdCvZ2ZwG9aepzkEDgFUgG 3KYsDxIev/tG21i+CqXYRjR/XPwk0iahO5Yqe X-Google-Smtp-Source: AGHT+IGYhUwKl8WQY4bhfC8oAHkU8+smb80iHqXN+gVWy92g1/5Fp2PJ/Sufl80dCykMu2X2LhyV5kwImVlJBjs+2eQ= X-Received: by 2002:a17:907:a0d6:b0:a3f:4596:c3c8 with SMTP id hw22-20020a170907a0d600b00a3f4596c3c8mr7093250ejc.53.1710266105420; Tue, 12 Mar 2024 10:55:05 -0700 (PDT) MIME-Version: 1.0 References: <20240305065606.ccr2ieheahslcpye@chazelas.org> <20240306175711.t3uz2sery3b6tbjw@chazelas.org> <90726-1709936102.086878@xlWC.oGpX.V4Q4> <34739-1710017038.959920@XhYc.enDL.DTxr> In-Reply-To: From: Bart Schaefer Date: Tue, 12 Mar 2024 10:54:54 -0700 Message-ID: Subject: Re: [PATCH?] Nofork and removing newlines To: Oliver Kiddle Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52730 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Fri, Mar 8, 2024 at 2:15=E2=80=AFPM Oliver Kiddle wrote: > > Why does it print command not found errors for things like ${|=3D|:}, > ${|*|:} and ${|?|:}, I'd rather have $? than it globbing for a single Bart Schaefer wrote: > See above about the requirement for it to look like ${|ident|...}. > Since =3D * and ? are not identifiers, this is like writing { =3D|: } etc= .> character file. On Sat, Mar 9, 2024 at 12:44=E2=80=AFPM Oliver Kiddle wrote: > > You may not be able to assign to it directly but I can think of uses > for $? (and perhaps also $!) if supported there. On Sat, Mar 9, 2024 at 10:11=E2=80=AFPM Bart Schaefer wrote: > > $? is also $status and ${|status|...} is fine. > > Pondering $! ... hm. This can be done with e.g. typeset -n bang=3D! ... ${|bang|...} ... And that doesn't even run afoul of history expansion, though I would not expect $! to be used that much in an interactive context. However: Returning to the original context here, we were talking about how to make ${ ... } more newline-trimming-compatible with $(...) while still providing a way to specify that newlines not be trimmed, and using ${||...} for the latter came up. In thinking about ${|?|...} etc. I realized that there's no real reason a set of non-identifier characters couldn't be allowed to follow the first vertical bar. It'd have to be simpler than just tossing parameter expansion flags in there, but I could investigate whether we could do things like ${|=3D|...} is the same as ${=3D${ ... }}, ${|~|...} is ${~${ ... }}, etc. That only saves 1 character, though, and I'm not sure it's clearer. It does mean, though, that we could use something like ${|<|...} for non-trimming command substitution, instead of "empty" || meaning that. Just from a "clean look" standpoint, though, I still like the quoting approach better. Separately, it's definitely possible to make zsh-mode ${ ... } trim only one newline instead of all of them.