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 21673 invoked from network); 8 Nov 2021 10:57:31 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Nov 2021 10:57:31 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1636369051; b=M7T/aVDsGjFsA96/Eg0GLGg12n++a8x25BuiAyaBXxoq2pLSoSSx966dqKTjYDFmYP2dmszF/h j42n5aZ4wjwIm67f7QIYsbA+G2oDkZg3pFiY6Jk9E8t83k4bVUuGj/wVgXlPAKjkNizjt1hy8b n2ow7Wr/4TrGVbkYdXKlZ1fNsf5ZPxQgSykNtw1FU91/T5xbSem1Qjp4vFeYvxIZZT9qVyS+6G nF81kzQUAR2M/4KFebBZ5Ob18v8ocgUao8WSuMs8YYnyHEEEAcoKqB2p1C7dRG4xA1LvRZpDhK /f+G9TNoFtGFZ9inHvds+5BobWDSCcdEK9oSYswStyIw/g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd01014-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.30; 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=1636369051; bh=xYe3CezpeV0mmPfu7Jt01ntVzcaNh3g2xxh4/b6lqdY=; 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=Z9fBDUEclLQ+niBWRPTnJqV8z0OpWZoX76PvlLzNqGKcRNcCaN2pg5edR6AKBIZfqjvL1Fo9fj c9S+Bl178e9hIM312FqiPqLzr5MPldJLN+M/zHl1OfcV1go71EMmtFmBrxyhTOczKNEC9EcKat LtECVRdDabUh7ko9jo+cu0op/xkADFYM8ZSya2Zatp8qkJGtWUVbzIhWzOJudA+P9sMCXDa/5t 5xQjL0cPvAW83qKujsEdBRH6YEz2Y/3uoT475DcafaQENCI/UdFwwN3fvOsFRFfUJFzApcbbhv vT7vzkfrTGKYVeZwx5xgxEU5W+1Lca92dGPxTUMf/cdBBg==; 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=x3d4zOgSAOYU0McIqhVT0fNBNz/4+Y5YhJu1sJCANV8=; b=ZJUuHezuCFz3VmH2QkM67xED6h omfU+2Q3rrM6yH09UaJ5DqwOoBV70sFBV600Ua3ktYajiUD53oyOMqx7BqezfAou3hqPlNpqcoCUo Iq2HJr6fc+oGoZ0n43XhMzbk3EUfRH9HtN/ueIavuHuZ7p1GPq21rzxDhUf7jwre6tEhQfssVgIWf Vxmgr6xcC78edykiq6fYzSvr3lulYGRr6pZbrHc6IqZbwSjVpWdZfVg0AE/ffS6zv0wpexIxFoSo+ bJsaL/PlRjOZcHo8FvuhvKhG15WE6ZbQhnlDuv7YQXf/u00RAJsPxfE1T3QIbvJidz8LuBhR7JoyG 7OhZAMqA==; Received: from authenticated user by zero.zsh.org with local id 1mk2LC-000BSr-Ix; Mon, 08 Nov 2021 10:57:30 +0000 Authentication-Results: zsh.org; iprev=pass (snd01014-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.30; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd01014-bg.im.kddi.ne.jp ([27.86.113.30]:30881 helo=dfmta1006.biglobe.ne.jp) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mk2Kf-000BCM-OB; Mon, 08 Nov 2021 10:56:59 +0000 Received: from mail.biglobe.ne.jp by omta1006.biglobe.ne.jp with ESMTP id <20211108105650058.ZPKH.16380.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Mon, 8 Nov 2021 19:56:50 +0900 From: Jun T Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: PATCH: list units in brackets at the end of completion group descriptions Date: Mon, 8 Nov 2021 19:56:49 +0900 References: <73806-1630065135.858692@atah.qJX1.Jyyu> <846a355a-d3e8-404a-ac80-4b0f5776d115@www.fastmail.com> <89303-1635367918.379239@3fX8._yj_.piD6> <6DF97A0F-0544-4D6C-BBD6-0D83B0AF272E@kba.biglobe.ne.jp> <72984-1636247814.729146@gNqB.dXT4.M5JK> To: zsh-workers@zsh.org In-Reply-To: <72984-1636247814.729146@gNqB.dXT4.M5JK> Message-Id: <2C471545-3339-4B78-BADD-B98336D3833D@kba.biglobe.ne.jp> X-Mailer: Apple Mail (2.3445.104.21) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 49555 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: > 2021/11/07 10:16, Oliver Kiddle wrote: >=20 > Do you see an issue with the behaviour of the following: > local alts > [[ -z $PREFIX ]] && alts=3D( 'sign:sign:((-\:"print all but the last = specified bytes/lines" +\:"print the first specified bytes/lines = (default)"))' ) > compset -P '+' > alts+=3D( 'numbers: :_numbers number b\:512 K\:1024 KB\:1000 = M\:1024\^2 MB\:1000\^2 G\:1024\^3 GB\:1000\^3 T\:1024\^4 TB\:1000\^4' ) > _alternative $alts It works if we use either "compset -P '[-+]'" or "_numbers -N". >> Or is it better to set them to 0 so that %(M etc. works? >=20 > The absence of any M: spec is treated as 0, unfortunately. Oops, sorry. I thought I've tested that %(M is false if M: is not given, but it seems I did the test in a wrong way. > Perhaps we should add an option to > zformat so that we can simply use $(m. %(m).) with no need for the > uppercase spec. (snip) > An option to zformat would not be backward > compatible for the format style (not that we ever used the feature but > someone might). (snip) > Or should we just stick > with M:1 and needing the else branch or a 1. I think %1(M is enough for the current purpose. (or set %M to 0 if unit is given, and nonzero otherwise; i.e., never = leave it undefined). But, in zshcompsys(1), neither the section for the 'format' style nor = the section for '_description' says that the ternary expression of zformat = can be used (or is it mentioned somewhere?). So if adding a new option to zformat would have wider use, then I think adding the option and using = it in _description would not break the compatibility. The format for the unit-suffixes tag accepts %d that is set to 0 if the suffix is marked as the default (such as :k:kilo) and 1 otherwise. This may cause some confusion, but I feel it is OK. --- Jun=