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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY
autolearn=ham autolearn_force=no version=3.4.4
Received: (qmail 21718 invoked from network); 23 Aug 2021 08:33:40 -0000
Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368)
by inbox.vuxu.org with ESMTPUTF8; 23 Aug 2021 08:33:40 -0000
ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1629707620;
b=EulEuGugEkAc+Z+EtIh9AoXc9v1wgcsacVEgRMBpA8v2PwlKb2tDfTUqMDnaQnXcp54IeqKc2H
4h7ynvQbkPYxWogoKFLFhffq1tL1ik1HKYfw2qtElK0Lns+S/T2E7Q2swLuGe8nyK8GKnZgS0s
jXczbcKZ/SAgOcHb3frv0xoSnOmtmAmi38CDvUthwZG97X7aD3lRqFGbD4lKTpFe3IgZGglsUF
es1yxEqQ5rcpuxtOlTW1Gds8aBPCOmk1HK96nKHLtZE/JYTq09cRNbI9tiaZKRs/yyiofefYVV
xGMIG9mha5ZRbUt55G3G9b+3Bpjej6NV+VSFoSlBxfHENw==;
ARC-Authentication-Results: i=1; zsh.org;
iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96;
dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256;
dmarc=pass header.from=ntlworld.com;
arc=none
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1629707620;
bh=wc/Vgh5I8YZvmjtIzlFMQLmFBLDvOmwQQujkRlOu1ow=;
h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help:
List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:
References:In-Reply-To:Message-ID:To:From:Date:DKIM-Signature:
DKIM-Signature;
b=X1lZR9AdY1Iuqq+dJ7MAOkE+1pa1Sx4d+DbcCjD3vAly/T0CJZYmo04xFv9MPALqjodHjORIf5
ArPvPwtbsHvgsxsVI0xZdqogpmeBzTVkoEoWzeDcbfYc5CdmMGDNUuakkoevvfstyK2LWfLPGY
2elCU2GtMB5LuNXMBpqfazp7G1Ajb9ASE3/5BXc7N2NOHhEQhY0Th1SQEAkiJ8AUChZFpR8LfM
meTvGqrSjObke2UseVqVzorWpbCXvUinHp9WTqP/auJnCGZAP4P6S6loHJf+tE4iz9ZY2RFwWm
nC5kj7UvwvJuxdjlau8w6ifyTFOSZaIgX3dyr22nAbdZpg==;
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:MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From:
Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From:
Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID;
bh=FFHO9YXTpDuvcDCPSdL/dARjc4p4PHOs9KHh32W5VlU=; b=CvYmQcWSaACVDLUkg1yB2jk5Eo
FjXsOZeBzTkDI4B9vX1/VfaommSyk6kwJcMEkBK6ooN+qvA5b0UE5RNa+G6PUdiemYzT/ELq0wzeE
nAgdzi2y0XvAoqZW2iPSzIerAzonITbf0HGbDY/ZzHItQPuftzd3kICvc1TidJQcm4kDsM6YUS8Vf
wsu7zVpRRM9EJYwF59UdST777rbZtXwZAuENADgWH78iKTgeX13FbHlxfPZCjVccqH5QFiLvil1ND
HtNFKKtf31CTCXAiTsC+ch8KV02itH51Pb5LT+ly6Dia7TIH0ixL5pS3g4AItb75XJtJaCUpFM90j
Qe2mC4LA==;
Received: from authenticated user by zero.zsh.org with local
id 1mI5Ol-000O3T-5P; Mon, 23 Aug 2021 08:33:39 +0000
Authentication-Results: zsh.org;
iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96;
dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256;
dmarc=pass header.from=ntlworld.com;
arc=none
Received: from smtpq1.tb.ukmail.iss.as9143.net ([212.54.57.96]:45244)
by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128)
id 1mI5OU-000NlO-16; Mon, 23 Aug 2021 08:33:22 +0000
Received: from [212.54.57.81] (helo=smtp2.tb.ukmail.iss.as9143.net)
by smtpq1.tb.ukmail.iss.as9143.net with esmtp (Exim 4.86_2)
(envelope-from
)
id 1mI5OT-0003xk-Dl
for zsh-workers@zsh.org; Mon, 23 Aug 2021 10:33:21 +0200
Received: from oxbe8.tb.ukmail.iss.as9143.net ([172.25.160.139])
by smtp2.tb.ukmail.iss.as9143.net with ESMTP
id I5OTmfhFMZ49GI5OTmQXUL; Mon, 23 Aug 2021 10:33:21 +0200
X-Env-Mailfrom: p.w.stephenson@ntlworld.com
X-Env-Rcptto: zsh-workers@zsh.org
X-SourceIP: 172.25.160.139
X-CNFS-Analysis: v=2.4 cv=XZHqcK15 c=1 sm=1 tr=0 ts=61235d51 cx=a_exe
a=pgSR3NrKiwmx/6vnWRL19w==:117 a=sfM75MaK4YAA:10 a=IkcTkHD0fZMA:10
a=2y5beTJ5bSgA:10 a=NDZmbbr1PBLIjIZTfUYA:9 a=QEXdDO2ut3YA:10
X-Authenticated-Sender: p.w.stephenson@ntlworld.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com;
s=meg.feb2017; t=1629707601;
bh=wc/Vgh5I8YZvmjtIzlFMQLmFBLDvOmwQQujkRlOu1ow=;
h=Date:From:To:In-Reply-To:References:Subject;
b=N4KVV0B82rY92MSN5vNl+m4JOPM841VBLJfCCmX9Lcom4qUFM2YYgiBuE690celGN
N0TDVcGkQbSde9HMae3AVwBs85ZITmyPcWe5W9M8gvrVcnbp0xhVSrFylNQZQs2d37
Vih142a3Jx0L4v/y56Vh17KU+Q8vN4nfh7w5JIWArOCMR3G4Gyi4a0meyShgnMQwNl
5FxpyI2ko6xFV8wQUtiFx9GAOgSf8XgvH48ZitR1V3TnQZS3K8BqrpMNkdZdIOZr+H
qZmfrHmSGt1DeLW0wOtn1wByLApesXeyh/NpTiTZQbFerZsXXSZP4XPkooLKMNCzjA
0cdDafEO4RqsQ==
Date: Mon, 23 Aug 2021 09:33:21 +0100 (BST)
From: Peter Stephenson
To: zsh-workers@zsh.org
Message-ID: <27858812.1079792.1629707601122@mail2.virginmedia.com>
In-Reply-To:
References:
Subject: Re: [BUG] zf_ln complains about the wrong argument
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Priority: 3
Importance: Medium
X-Mailer: Open-Xchange Mailer v7.8.4-Rev72
X-Originating-IP: 165.225.81.118
X-Originating-Client: open-xchange-appsuite
X-CMAE-Envelope: MS4xfCSqXtADrB2Gq6dw3uMBvu3CLH/mabkbj51Dzh5FALVXRpHt6iD9Pe23ECfPfNDypuDq+vK03Hpck5UQf1MCwdlXbWI8GY4yIpo9d5d2he/Qczny7qfw
M7ydny5XMuZrYmp0DcOroI3/WvxUDGEi+5+QYg5nX76/mt7MifX+aPZSsp4Y2A6OusMxoPFw4ZbDJbjoYa3JeN7oNct09Y4fVsF4iXVXD7NSw7aU+NwSrEkH
X-Seq: 49300
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 22 August 2021 at 22:05 Daniel Shahaf wrote:
> Peter Stephenson wrote on Sun, 22 Aug 2021 20:24 +00:00:
> > Also seems a good idea to turn a null string into a couple of quotes. =
I
> > thought of modifying the error message handler but this has too many
> > knock on effects.
>=20
> What "knock on effects"? Extending zwarning() with a %q format code
> that takes a =C2=ABchar *=C2=BB and outputs it quoted seems like a good i=
dea and
> shouldn't break anything. Will handle filenames with spaces, too.
This is certainly all stuff that's accumulated rather than been planned
over the years, but having a harder look I think it's mostly not too bad
the way it is. I think the basics are currently as follows.
%s as implemented in errors and warnings is already not a straight=20
printf %s: it uses nicezputs() to emphasise visibility rather than quoting,
i.e. it's there to make it easy to see what the error is about, rather than
easy to copy back into the shell. Given the error is about something that
would usually be either in a script or on the command line, this doesn't
seem a bad way of doing it, on reflection.
As far as quoting is concerned, the state of the art is to use `%s' (i.e.
with those literal quotes) if it seems necessary to draw attention to the
argument, i.e. it could get lost otherwise. There are a lot of cases
where we don't do this, however, but they can easily be changed. The
combination of this and nicezputs() means you can always see what's
there, unless there are very subtle cases I've missed.
So I think the consistent way of handling a case like this is to turn
%s into `%s'. That both makes it visible what's going on and makes
the output consistent with similar cases elsewhere.
Does that seem reasonable? I can't think of a strong argument for a
more widespread change given it's sort of working and even sort of
potentially consistent.
pws