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 E118325C9C for ; Fri, 23 Feb 2024 01:49:46 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1708649386; b=D7SmQ/mG0thHZVngi7ar8s5GCSLzpgbOtYn0knVmQjccJ3r9QzbQ/TRT5r32eF3/VMY8OnNzsq 4rZWutpPWT09H1LTGBQPbLty3QVbqKnCoCzWncuHgzAfiKCELxkbn4CE/RagT4nGFLl07U7aZz +FPcIPgbmzEDC5/NB0pe6FE9eYRpBvk/bzjBHBu4uihuUgwqw8G2jabkpQpYhLZ7332cMfVQMl xzLyBJLPIqeIdOAjivFybzaAxBd1Sng9fAWHwEft7z6yAuFawXQD3njP/27i2fHPWrj90bTBUD fgivZuwMXcj6iH20Bx1U5VOqjq29GGCnqmCqHdbvDfefbQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f46.google.com) smtp.remote-ip=209.85.218.46; 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=1708649386; bh=h/S/2jP8BUdGf50FG2krvaE/w/uq9CZkhk5evC191wc=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature:DKIM-Signature; b=cIwVMsoH+lEpb2oQA0JbR3iQdo2ufFVlxAYBxarjoC065xKz2rkkuHJdjpy64eYPeTWThWudYQ SE4w6yOgOY1yH7j3wjSIu1VgJctZ1H12qMsZ7wySfpo1yw9c5PmAbhiYDFgqtY62sonyv9t3DT 1U03Mtn0YlG7pB4H33Y4T6/2vcQi4XHtgSTxQodiGpDvC3XvWtMWgfxYzk70AIpmFgpklXHhFR DYu2IrOSvaImnRwLdfYxbz4hsmsYyLj8qQ1oYgJcXp6IonPxNUbHBXXckn0/xgHW/PKH/SaCGF ToJscv6arSDOuIA/HkmPUhKBBxDhSTf6rQPf+U77Ob0WqA==; 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:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=qUlDFwzBDkyOW7MdqO4NYgWGOmCfB6uGm5qro3uhVtA=; b=gsLEs3Yum7otAt2JodBJZkVJzD whn587FeQfZ8PRa6Sx+9knhL2NK0u2fRYA7MA59mzkSwlKzOMvXKN37uJ5tTLxj8NWq3fEo/Atwhu jdwitdJ1AXh/UGGMwfhPLg+4+fZ18bLCQ808vUilimj+HIv6riaugiyCTZmywfjU+9sdcp/JcYKGp F/Nat2TerYiUbztD/xukKHU7NAdqb4yr2mPWjqd6jo3GgES+BBaCoAbpjoeM7zWR+RngQPgVZ50oF fXTsDViv9dZJ31BnAHOjXg1W5VGs2OnmAFSo0+pLFD/rLocvVMpjhR+TBb3EyJPs13FkKBZh5SmSy GDiuXLWQ==; Received: by zero.zsh.org with local id 1rdJl4-000KAA-DL; Fri, 23 Feb 2024 00:49:46 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f46.google.com) smtp.remote-ip=209.85.218.46; 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-ej1-f46.google.com ([209.85.218.46]:54699) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rdJkq-000JqO-7W; Fri, 23 Feb 2024 00:49:33 +0000 Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a3d01a9a9a2so32086866b.1 for ; Thu, 22 Feb 2024 16:49:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1708649372; x=1709254172; darn=zsh.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qUlDFwzBDkyOW7MdqO4NYgWGOmCfB6uGm5qro3uhVtA=; b=J9T637lfRQfqgMbSkABQIpAaxTnuAdvR8gH3GEZ1HzNng2ZOi/emAVf037cdZdj7C9 hKNjinG+gSp5kgT/oTCeSoJZZnKSdpiDEK4O9qwbcn+mNRD3KVtlnfDlLZOMVuZEqLQ9 0RFNRrBzxlF9EHCLfepn624EtBwFel6ZUVCfJrg3fo0xaOsbzXI+6ZOx2ixgQxbX8jCu 24Wy4Dk17uQKEWOtVLU8didQ+uf4XKk51wgm81ZRnnlPI85UAX6jjWKe+j2tc1ykKNuA bRvJ8JpZQB1tg5qAWO+f7yJjqZYWZEvkx0wysCnwYyRAwS8tFkfGvXGE72HRyXw2h5I5 81yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708649372; x=1709254172; h=content-transfer-encoding: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=qUlDFwzBDkyOW7MdqO4NYgWGOmCfB6uGm5qro3uhVtA=; b=ZtuLkjcSjqe1hjulKWauDirI0jTE8+ysJaDktB4guYzmLNLp4zdlxQhbGDxjB8i8/Q ec1jCBrYhuir+/aWVj7LSqK2TmmAZERpuopp52IIbLsRKrrRlBZtZLG+yLlYnDD8iwsw CaBOiS8mxvYk8K18MQK2zVXs2miyiKTkYgm9mbxi2ntpAGaiJbzbZ4rNyeJia2vwQ6Nf GHWt8dfXMHszXcuMZvePuXMFrU4DxTldOMHa6sber332xiFoL/Pr1La6Ir10Oag3OPtj 3uoEIGjuhhDPJmirNwP050kPPW+9lDswQPGZHWu7X6xyJ2PAtnLHxWuoR4S/zyF0UoNp 7ADA== X-Gm-Message-State: AOJu0Yx6+3GrE31/FjeZOm2TezD+3jzbvlyjLStOU8r3TzRzRCUcttEk hJgmZT7NCrw9m3N9N/gdjm8/kxtPNrN7ALUejPyAwxMSVsc6XkOv45qTNfS9Zarn64amxmcs5TR JZGe3doy3bqVTLkJj/pnYw54m/bE7bPhwqrfHVWK7JIhphrkq9w== X-Google-Smtp-Source: AGHT+IEKRa4cjOC/NG8OvhjBt7YkETjBaxm0iOa7QSYg+JMNOfaUghiDPd4q8JrB8wIMlcbG5EEkLoyMHWunZbdCFKE= X-Received: by 2002:a17:906:168a:b0:a3f:bd10:427b with SMTP id s10-20020a170906168a00b00a3fbd10427bmr227500ejd.59.1708649371767; Thu, 22 Feb 2024 16:49:31 -0800 (PST) MIME-Version: 1.0 References: <836025199.2014747.1673889335246@mail.virginmedia.com> <20240220070505.fd6jfbcdldieqv7u@chazelas.org> <20240220193911.avnmcqfliwltkj5m@chazelas.org> <20240221194534.o2mufin7orng6ttg@chazelas.org> <20240221202150.tccftcqbxqqexq4x@chazelas.org> <20240222072313.7woy5vxvt4fbxyhj@chazelas.org> <20240222075528.eruaoosiuhmcrdsy@chazelas.org> In-Reply-To: From: Bart Schaefer Date: Thu, 22 Feb 2024 16:49:20 -0800 Message-ID: Subject: Re: Metafication in error messages (Was: [PATCH] unmetafy Re: $var not expanded in ${x?$var}) To: zsh workers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52582 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 Thu, Feb 22, 2024 at 2:31=E2=80=AFPM Bart Schaefer wrote: > > Another possibility therefore is to to have %l do raw output but NOT > unmetafy(), so the caller would need to either unmetafy() and pass a > length, or nicedup() the string when that was the desired output > (which handles the unmetafy() internally, and nul-terminates). The changes for that are minimal. With them, Stephane's math-garbles handle the ellipsis more cleanly: % printf '%d\n' '1+|=C3=83=C3=83=C3=83=C3=83=C3=83=C3=83' zsh: bad math expression: operand expected at `|\M-C\M-c\...' 0 % ((1+|=C3=83=C3=83=C3=83=C3=83=C3=83=C3=83)) zsh: bad math expression: operand expected at `|=C3=83?=C3=83?=C3=83?...' And the ${..?..} error messages come out as expected: % err=3D$'one\ntwo' % print ${a?$err} zsh: a: one two I'm not sure what if anything to change about yyerror() in parse.c, it's already untokenize()ing what it passes and maybe that shouldn't be "nice" anyway? No patch until I have more feedback, this time.