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,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26154 invoked from network); 21 Feb 2022 13:36:58 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Feb 2022 13:36:58 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1645450618; b=mpXqLJ4ouc+SnqfFkBE2kDgCxfAsNDGwY0H2plphv6BZIYqNBZhiZYqbLHAT2p/Ik7p/KI9zzM QyCySIJuCkR3dR+YwaBRtK96KvVy4JyXHdVFK2YopTo2P8TBXAc046Qo1sNGyxX/CBEWxv5w6o 2ldGUkTY60lq4spyVebWBML35SiGmUBGwWppnC3Qao4UTua4rv0Nr/s38vIPsXlZ11PqQMfNA4 VU4NArhvkrvkGVI9h1hkrsI2bxB15oeLLTQeztEZmxZqu63l/Lx4ga/80fA9F6DKEk3IZhD3De odPTgm9F7IeBYb5nz+3YAFvDaaKH/27eQ9ifCYaAzpopGg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd01011-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.27; dmarc=none header.from=kba.biglobe.ne.jp; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1645450618; bh=AI2xDP8R83lJTLszaWzQfjJ24VTjesve5v55nFcbqic=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Message-ID:In-Reply-To:To:References:Date:Subject: MIME-Version:Content-Transfer-Encoding:Content-Type:From:DKIM-Signature; b=X2DByu3RbrOL8qAYRKTTTHtLs6k54dIVxck7UtbAE/ZmCcVN7FCzZBS/3ueHd2g9VT50OvGV8i yca1RT363TTC3EXPXynOvPG+BnnPZVINoEKquSeNr34+xJu+sp2wIAWW3x9y2sRO2lj+7fbhaf chJBEkTdGupBIi27gEULQrmSpHGqbs285bMTnyw7vqUnHwIip2/Ew8QBy1Ljn3gE9QZ1GgmpXo LuyOpoABRKcSKjQElg+BWwa9u58Kz/6mxf3NTL8WxBw/EJmzkPTqfpEdQU4NGqyYuGYc5IryB7 Q5UeOACtMYY5FrFnIywePAOrikSZwYn38UNTZXnJr2BA5w==; 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:Message-Id:In-Reply-To:To:References: Date:Subject:Mime-Version:Content-Transfer-Encoding:Content-Type:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=SZLJlaTn0iGcBDzTmyPQD9dtCoTNg2GwTfMkJT/l3yQ=; b=K6D58w4UKe3jk1Vj9Ykav+kErs k4awO4l03Mj5Yui48a5iszhp4ueoIvhngJStiOIfA9wmLYp2MC3Rq/1ajvrTeonBfVfz+mJ3vKPpz v2i8rpbX0FRViD4XTU8Eh6RjJUYIDsd4av4V+w8Mgp6f2Fk2Mwiv61NyLXdqvUdP+xsqYsxW7MrDv 5QmoK6KDHSQ1xq9TpBFsQhaYCn3Pp3VSp9N0rg+ZldVjR92cgD5J4jvDkhMYzZG7xSCn91IPPovfM 4e6N2D+HuHVrN7/T99HOo4mwM4ycLrdM5EepxpuDv28MvXLhVqVenfBbe0xXH7gbmBr7D+R7NoHzT JSU0+Fsw==; Received: from authenticated user by zero.zsh.org with local id 1nM8s6-000JiE-BW; Mon, 21 Feb 2022 13:36:58 +0000 Authentication-Results: zsh.org; iprev=pass (snd01011-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.27; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd01011-bg.im.kddi.ne.jp ([27.86.113.27]:47712 helo=dfmta1016.biglobe.ne.jp) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1nM8rp-000JO4-FF; Mon, 21 Feb 2022 13:36:42 +0000 Received: from mail.biglobe.ne.jp by omta1016.biglobe.ne.jp with ESMTP id <20220221133637662.FBWZ.85532.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Mon, 21 Feb 2022 22:36:37 +0900 From: "Jun. T" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.40.0.1.81\)) Subject: Re: [BUG] _less incorrectly completes -" and -# Date: Mon, 21 Feb 2022 22:36:37 +0900 References: <70628-1601650043.378616@hQ3l.BrEr.w3GB> <59878-1634948764.966966@18Tx.APRj.e74Z> To: zsh-workers@zsh.org In-Reply-To: <59878-1634948764.966966@18Tx.APRj.e74Z> Message-Id: <4584088F-C715-491D-BC24-3916C7A22662@kba.biglobe.ne.jp> X-Mailer: Apple Mail (2.3693.40.0.1.81) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 49766 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: This is the minor problem I mentioned in the previous post (49765). > 2021/10/23 9:26, Oliver Kiddle wrote: >=20 > This is digging up another fairly old _arguments issue that I meant to > deal with before: >=20 > On 2 Oct 2020, I wrote: >> Roman Perepelitsa wrote: >>> Completing `less -` offers `-"` as a candidate. Accepting it = literally >>> inserts `-"`. I think it should offer `-\"` and insert the same. The patch (commit 4e9d00) has solved this problem, but a few problems = remain. zsh[1]% less -\" The 1st TAB inserts a space, and the 2nd TAB offers list of input files, but what is expected is a message "quoting characters". zsh[2]% less -\"cc - this still offers --quote and -" zsh[3]% less -\" cc - this gives "No match for: 'file'" Since ca_parse_line() (computil.c:2009) does not remove the escape from = the -\" on the command line (see line 2080 and below), it seems it is not = recognized as a known option. If I quote the -\"+ in the spec as '-\"+' '(-" --quotes)'{'-\"+',--quotes=3D}'[change quoting character]:quoting = characters' then the above problems seem to be "mostly" solved (in case [1], for the 1st TAB we also get=20 -" -- change quoting character in addition to the correct message). But with this spec: zsh[4]% less --quote=3Dcc - this still offers -" It seems we also need to escape the " in the exclusion list: '(-\" --quotes)'{'-\"+',--quotes=3D}'[change quoting character]:quoting = characters' but is this a good way of fixing these problems? (this patch is against the current master, not including the patch in = 49765). diff --git a/Completion/Unix/Command/_less = b/Completion/Unix/Command/_less index ae912a633..7ba665069 100644 --- a/Completion/Unix/Command/_less +++ b/Completion/Unix/Command/_less @@ -80,9 +80,9 @@ _arguments -S -s -A "[-+]*" \ '--no-keypad[disable use of keypad terminal init string]' \ '(-y --max-forw-scroll)'{-y,--max-forw-scroll}'[specify forward = scroll limit]' \ '(-z --window)'{-z+,--window=3D}'[specify scrolling window = size]:lines' \ - '(-" --quotes)'{-\"+,--quotes=3D}'[change quoting character]:quoting = characters' \ + '(-\" --quotes)'{'-\"+',--quotes=3D}'[change quoting = character]:quoting characters' \ '(-~ --tilde)'{-~,--tilde}"[don't display tildes after end of file]" = \ - '(-# --shift)'{-\#+,--shift=3D}"[specify amount to move when = scrolling horizontally]:number" \ + '(-\# --shift)'{'-\#+',--shift=3D}"[specify amount to move when = scrolling horizontally]:number" \ '--file-size[automatically determine the size of the input file]' \ '--incsearch[search file as each pattern character is typed in]' \ '--line-num-width=3D[set the width of line number field]:width [7]' \