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 12630 invoked from network); 14 Dec 2021 17:35:26 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 14 Dec 2021 17:35:26 -0000 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:Date:Content-ID: Content-Type:MIME-Version:Subject:To:From:Reply-To:Cc: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=sZdEy8Yvi0Ti3Xw5ZOqAI3cfTG4gMMIEEDUbZkQHwxs=; b=ZE5AmmIjQFY0R0mSOV9fPfLvKo WqhPBNTMm43xvfNyW9iC43ZXechfkQemBBrwhSVbZ2rLEJyfLEsYCnR9jhjTQnmKcNkLT4OHlGFW1 ZdFnSTIQ1oj6di+Dx0qJnHJSy4SCxNA7G72io69fSKUMjOmnwlYUKgb0TmNVHcnOxHZBZXeju22s5 LbujRTRUKbZjEHDM3JLlkTXF3HKA+h+aYFGntlXH6xZx4+uUdl2kw+PwHDux/QTTue7VtywlTx5eq bzEHvgaox5Jwc5KnVrBaM89wp7SlANrKUv+Se3IXprrYNyPUZNuvJNmI+TwQkMlcyP+f2qwdqSO2C ixKVl5XQ==; Received: from authenticated user by zero.zsh.org with local id 1mxBi0-000JDW-RQ; Tue, 14 Dec 2021 17:35:24 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mxBhm-000IuZ-OB; Tue, 14 Dec 2021 17:35:10 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.94.2) (envelope-from ) id 1mxBhl-000LHK-Ka for zsh-workers@zsh.org; Tue, 14 Dec 2021 18:35:09 +0100 From: Oliver Kiddle To: Zsh workers Subject: PATCH: meaning of before/since for date glob qualifiers completion MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <81796.1639503309.1@hydra> Date: Tue, 14 Dec 2021 18:35:09 +0100 Message-ID: <81797-1639503309.634798@2hZQ.8n-8.PNRX> X-Seq: 49648 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 a variant of the github #80 from Vincent Bernat. Descriptions of just "before" and "since" are perhaps ambiguous because it can depend on your perspective as to whether the specified date is before/since the file time-stamp or the other way around. For completion, we tend to be focussed on the value entered but in actual usage the age of the files is perhaps foremost in people's mind. This inverts them as per the github PR but also adds a brief parenthetical. I'd prefer to keep the descriptions as brief as possible because _dates expects most of the terminal is available to it. Oliver diff --git a/Completion/Unix/Command/_find b/Completion/Unix/Command/_find index 8ff60baf2..74111f92b 100644 --- a/Completion/Unix/Command/_find +++ b/Completion/Unix/Command/_find @@ -156,11 +156,11 @@ if [[ $state = times ]]; then if zstyle -t ":completion:${curcontext}:senses" verbose; then zstyle -s ":completion:${curcontext}:senses" list-separator sep || sep=-- default=" [default exactly]" - disp=( "- $sep before" "+ $sep since" ) + disp=( "+ $sep before (older files)" "- $sep since (newer files)" ) smatch=( - + ) else disp=( before exactly since ) - smatch=( - '' + ) + smatch=( + '' - ) fi alts=( "senses:sense${default}:compadd -V times -S '' -d disp -a smatch" ) fi diff --git a/Completion/Zsh/Type/_globquals b/Completion/Zsh/Type/_globquals index 915f97c1c..bc3165eba 100644 --- a/Completion/Zsh/Type/_globquals +++ b/Completion/Zsh/Type/_globquals @@ -127,16 +127,14 @@ while [[ -n $PREFIX ]]; do alts+=( "time-specifiers:time specifier:compadd -E 0 -d tdisp -S '' -a tmatch" ) fi if ! compset -P '[-+]' && [[ -z $PREFIX ]]; then - sdisp=( before exactly since ) - smatch=( - '' + ) if zstyle -t ":completion:${curcontext}:senses" verbose; then zstyle -s ":completion:${curcontext}:senses" list-separator sep || sep=-- default=" [default exactly]" - sdisp=( "- $sep before" "+ $sep since" ) - smatch=( - + ) + sdisp=( "+ $sep before (older files)" "- $sep since (newer files)" ) + smatch=( + - ) else sdisp=( before exactly since ) - smatch=( - '' + ) + smatch=( + '' - ) fi alts+=( "senses:sense${default}:compadd -E 0 -d sdisp -S '' -a smatch" ) fi