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 24987 invoked from network); 21 Feb 2022 13:27:16 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Feb 2022 13:27:16 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1645450036; b=BqoisoF2IvarviqGB8yJQasjvXAqleA25cJI9H5HnxqRUG+/AOlPe4mhrG29P1VOs4K+xfY5J7 ccoBSZwHhZbBNkv94U//1xb2PiN1fuSCGTvHWkBVazGOy0E/foykb7AxkDhh+Gv29x7BVhWeZk p/319D2cjVpOR/pVF8Ls8xQFEBwKXPGrz+EQZnUiD+NulxpopobYq/oYpi1EnsgBJmqPo4VVLc 1jHjQxdwjlqifB89AtAWAG0osEPs8ADc/r5BBIpAKd1azTQp7pfhEwBdblsNtHP4rh0qHkMJRm FxDnHX+v+UeguKeEejdDnLJKSlqohm9YOwZHLU9Fs+wF0Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd01004-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.20; 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=1645450036; bh=uJkHND+VOQQEylI5P9yjV6eWB4lQIOXF+y0QolcOGn4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:To:Date:Message-ID:Subject:MIME-Version: Content-Transfer-Encoding:Content-Type:From:DKIM-Signature; b=hXUxqJDCQD1aD8DP9atPlgtHu+bRzyt4buez294KJThfokxC0HyxFzXIbRrsA5VJRp1yMuMAn9 MGn5FWqIyBh4k0Z5AxiSHILFO9OWT1Fcw/DlFGlmw1qDnzblY29ekQEqT5cAKGzPNdUVcniTGE DKAaWoRGuzNc9sGJXke9k6ePRbnaRJAXtEVijAeFXB9JkKC2ozBlVO9l9sYhMMMqienDSZl121 db2FT1IvVld197LxsocJE/gNV+tzzOwuVIEtiorgrys5G6T5OtmF6zQGzUXdz/iOIoKOmy4Hx4 dCwtooIhuDLJRk2/DF2yoaqvF/dSU3ut5kvJSVKpt3uNgA==; 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:To:Date:Message-Id: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:In-Reply-To:References; bh=5Knfdq8s0G0srTQGMiuUtlKg13vZRNckB5v/iofXVJk=; b=OhYsyu7QAxLvq1XDfM564xW7hB nUpgAVLm2t70Mt8veLkab87opI+S3LtcTp8pLoK7sfUIg0u+3JQ2j+F8my/YaHztClHrxtZuj2e6V 5oC/0sOj1oMGcBuy/Q+7YkeeB8J6NViGeqHzJyqyMwo0DFgW2oPwJkc/lZzYlP6kExFxVeQf+Mcdj xuj4CqlkugS7sgxQ0pdunmzdRe3E72P/ZwCPPnwC99Tcxjz/HE+LCO19wGrcZpsXKKv8eOeuLhZzT ImP60KCR2+Dymal00vx/LQrOvb3/63EIOo9JkNrvlZTyqfmF2d/3yzoJciCc+cmZdOceAeAEQP1mJ vLw81ifg==; Received: from authenticated user by zero.zsh.org with local id 1nM8if-000Iy9-Nl; Mon, 21 Feb 2022 13:27:13 +0000 Authentication-Results: zsh.org; iprev=pass (snd01004-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.20; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd01004-bg.im.kddi.ne.jp ([27.86.113.20]:16865 helo=dfmta1011.biglobe.ne.jp) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1nM8i7-000IcS-6P; Mon, 21 Feb 2022 13:26:41 +0000 Received: from mail.biglobe.ne.jp by omta1011.biglobe.ne.jp with ESMTP id <20220221132632437.BTEG.98623.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Mon, 21 Feb 2022 22:26:32 +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: [PATCH] _less: add --color (synonym for -D) Message-Id: Date: Mon, 21 Feb 2022 22:26:31 +0900 To: zsh-workers@zsh.org X-Mailer: Apple Mail (2.3693.40.0.1.81) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 49765 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: --color is a synonym for -D. Also recognize - as a default color, so that less -Du- offers background color. While preparing this patch, I've noticed another minor problem of _less but how to fix it is not obvious to me. I will discuss it in another post. diff --git a/Completion/Unix/Command/_less = b/Completion/Unix/Command/_less index ae912a633..0a72782ef 100644 --- a/Completion/Unix/Command/_less +++ b/Completion/Unix/Command/_less @@ -39,7 +39,7 @@ _arguments -S -s -A "[-+]*" \ '(-C --CLEAR-SCREEN -c --clear-screen)'{-c,--clear-screen}'[repaint = screen instead of scrolling]' \ '!(-c --clear-screen)'{-C,--CLEAR-SCREEN} \ '(-d --dumb)'{-d,--dumb}'[suppress error message if terminal is = dumb]' \ - '*-D+[set screen colors]: :->colors' \ + '*'{-D+,--color=3D}'[set screen colors]: :->colors' \ '(-e -E --quit-at-eof --QUIT-AT-EOF)'{-e,--quit-at-eof}'[exit the = second time end-of-file is reached]' \ '(-e -E --quit-at-eof --QUIT-AT-EOF)'{-E,--QUIT-AT-EOF}'[exit when = end-of-file is reached]' \ '(-f --force)'{-f,--force}'[force opening of non-regular files]' \ @@ -104,7 +104,7 @@ if [[ -n "$state" ]]; then if compset -P 1 \?; then [[ $IPREFIX[-1] !=3D [a-z] ]] || compset -P 1 + || _describe = 'color application' '( +:add\ to\ existing\ attribute )' suf=3D( -S '' ) - compset -P 1 '([a-zA-Z]|*.)' && fgbg=3Dbackground && suf=3D() + compset -P 1 '([-a-zA-Z]|*.)' && fgbg=3Dbackground && suf=3D() basic=3D( B:blue C:cyan G:green K:black M:magenta R:red W:white = Y:yellow ) _describe -t colors "$fgbg color" \ "( -:default ${(j. .)${(@)basic/:/:light\ }} ${(Lj. = .)basic} )" "$suf[@]" && ret=3D0