From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20220 invoked by alias); 7 May 2016 22:09:31 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 38420 Received: (qmail 25317 invoked from network); 7 May 2016 22:09:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 From: Frank Terbeck To: zsh-workers@zsh.org Cc: Oliver Kiddle Subject: [PATCH 6/6] _baudrates: Make style lookups fit better with the rest of compsys Date: Sun, 8 May 2016 00:09:16 +0200 Message-Id: <1462658956-11785-7-git-send-email-ft@bewatermyfriend.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1462658956-11785-1-git-send-email-ft@bewatermyfriend.org> References: <27858.1462193719@thecus.kiddle.eu> <1462658956-11785-1-git-send-email-ft@bewatermyfriend.org> X-Df-Sender: NDMwNDQ0 To quote Oliver Kiddle: > The original concept with styles was that style's could have fairly > generic names because the context allows you to select the detailed > context. So perhaps consider allowing this to work as, for example: > zstyle ':completion:*:*:screen:*:baud-rates' max-value 9600 --- Completion/Unix/Type/_baudrates | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Completion/Unix/Type/_baudrates b/Completion/Unix/Type/_baudrates index c1ee3f4..d43b9f1 100644 --- a/Completion/Unix/Type/_baudrates +++ b/Completion/Unix/Type/_baudrates @@ -23,9 +23,9 @@ # It is also possible to override the arguments to -f, -u and -l via styles in # a similar fashion: # -# zstyle ':completion:*:*:screen:*' max-baud-rate 9600 -# zstyle ':completion:*:*:screen:*' min-baud-rate 1200 -# zstyle ':completion:*:*:screen:*' baud-rate-filter some_function_name +# zstyle ':completion:*:*:screen:*:baud-rates' max-value 9600 +# zstyle ':completion:*:*:screen:*:baud-rates' min-value 1200 +# zstyle ':completion:*:*:screen:*:baud-rates' filter some_function_name local tmp local -a expl rates @@ -53,9 +53,9 @@ zstyle -a ":completion:${curcontext}:" baud-rates rates || 115200 230400 460800 500000 576000 921600 1000000 1152000 1500000 2000000 2500000 3000000 3500000 4000000 ) -zstyle -s ":completion:${curcontext}:" max-baud-rate tmp && opts[-u]=$tmp -zstyle -s ":completion:${curcontext}:" min-baud-rate tmp && opts[-l]=$tmp -zstyle -s ":completion:${curcontext}:" baud-rate-filter tmp && opts[-f]=$tmp +zstyle -s ":completion:${curcontext}:baud-rates" max-value tmp && opts[-u]=$tmp +zstyle -s ":completion:${curcontext}:baud-rates" min-value tmp && opts[-l]=$tmp +zstyle -s ":completion:${curcontext}:baud-rates" filter tmp && opts[-f]=$tmp if (( ${+opts[-u]} )) || (( ${+opts[-l]} )); then local -i min max -- 2.8.1