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 7622 invoked from network); 9 Apr 2021 19:50:29 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 9 Apr 2021 19:50:29 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1617997829; b=rbUSs5aApTGyOntzxEK+Ca4f6YmVNuC+ZzGcNz1zYcB3el91jbRmHXXEjDrqdsXyyz24RKOndz qleluT2XvD0TE/lUw5UAJYcgaviHlPGsvjhtqmh3e3OxbqhA288uK3kHgJSCFDWkyl0Nl6oE1Y uXzh4Kc72yJY83KUMCOG60IaZQ8vTaNPjxZOvnBzl/Pl155RSxe+y3Qyg2dCZYIlirb+mKhAF4 RP3LetW7tgRyrkPZLZrsOnsQZ0GKluqospygxcJCmIGCZUdnkIBayWg528ippHV/B/VfFk275M zzm2HAhQksb6rPDBiDrusl1Ypo2X8SAXgOWDIkKMkTH7rA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (aurora-borealis.phear.org) smtp.remote-ip=188.42.45.194; dkim=pass header.d=phear.org header.s=20180217 header.a=rsa-sha256; dmarc=none header.from=phear.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1617997829; bh=fGdmlE42QeTpS4Y9onmEFLN9H/ayy6llR7LXLuQaSY0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:MIME-Version:Message-ID:Subject:To:From:Date: DKIM-Signature:DKIM-Signature; b=rjiNr/U8Gzxpirk91ic69Nad3d2Ef3cjiXW5lcY6zjJHE+9+kVxiHDQoiU8TdvbB0QnYwwnxa9 tNEKe6cZdry+T6dbDN6eRlnvB3KSmM6oY1Qth4zLA9Rs6aNtPIdvOp+VMgsFAG+P4DL5aGEE3s Sxg8JHQ6RZ2hOTcSN3TCdTPMrz0aEFhLL2s8YDD+FtXan3IRLSuoqBTk7LmkyW+nW4w893ilCw aXCMr76HJ47Mkpci0HnzMUvdnU7lXKH5Sq8Z0HL5SI/p4/UTJGJOm/4cZgSxQYu51li1RZMN2L /nPzkpbAhI3ro1ptSXmCdkVrv1fCCMnABqFy/4uMDvJHTw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:MIME-Version:Message-ID: Subject:To:From:Date:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=5+HaHTj1fXzwc3RY0g5TRvDNGwjzs03wrj2qgTwFE5I=; b=W3Kq424/ZLJmYTenUSrsu5k3t3 VgctVECU77NSaqsXPj0JCw6+Vagpekr2QkhhINBXu1GegEPdmENWRfMoWrr3rEQENN4MtPNUqFR8H PlPTApHPuZ6a+3Kqdny/egADiCh5gfz0ok6q0p5fhvpOd1iFlUGFxy+bXSZroHAFuZk0x0+uXR5ZO eO01F0W3cnJmmaK039wTpcL2i7Hp+8Gl7SAB0otZm2SiskQdtSUa3ylqQv1htYPVe7SQJjlcgPMtQ 7dIdD8l8NaK+yrn/W+CVVjqVivO7vVvvPRVWFLyvfW7pcQgH0MacPTm3ylggrxAdwGX3XLLggvbmu Lvae/AEw==; Received: from authenticated user by zero.zsh.org with local id 1lUx98-0006qO-Vx; Fri, 09 Apr 2021 19:50:27 +0000 Authentication-Results: zsh.org; iprev=pass (aurora-borealis.phear.org) smtp.remote-ip=188.42.45.194; dkim=pass header.d=phear.org header.s=20180217 header.a=rsa-sha256; dmarc=none header.from=phear.org; arc=none Received: from aurora-borealis.phear.org ([188.42.45.194]:57542) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lUx8f-0006ZE-Ga; Fri, 09 Apr 2021 19:49:58 +0000 Received: from localhost (unknown [127.0.0.1]) by aurora-borealis.phear.org (Postfix) with ESMTP id 51006FF33 for ; Fri, 9 Apr 2021 19:49:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at phear.org Received: from aurora-borealis.phear.org ([127.0.0.1]) by localhost (mail.phear.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id brNDZ1mIvZSO for ; Fri, 9 Apr 2021 19:49:53 +0000 (UTC) Received: from prometheus.u-strasbg.fr (82-65-50-238.subs.proxad.net [82.65.50.238]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: khatar) by aurora-borealis.phear.org (Postfix) with ESMTPSA id BC704FF32 for ; Fri, 9 Apr 2021 19:49:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.10.3 aurora-borealis.phear.org BC704FF32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=phear.org; s=20180217; t=1617997793; bh=fGdmlE42QeTpS4Y9onmEFLN9H/ayy6llR7LXLuQaSY0=; h=Date:From:To:Subject:From; b=uoPHL85rdzyaiu3vnwlurUxw5xATtSvxkNZnEDYx1jsptnR3tdCJiqlc7ctmNY8W5 52pV2hzs7hhDEN34zz/bUzO4KIO65hWw1IRSzTcyyZpo6YZl40UBP7h46qpo4NKSXO VesGreFUV+ZsZbeScMZ7GcIIivo+I5qeptIkgFztwWselYtzyV5L5sVyvSfYpoXxPV sgVyG7EJ8WVKueRoMWHtyq2OoD4lqr48W7at2zi2aMp6ALjA1I3oo8UvLm3F5TbY3p yJtqg2E8vKKUv1U/aJ/Yxb4G8Px7wR88ExU2q5sXjWRIS3s2NlE5b5KW2sB0+6Pb6q uE5sX5tXurD/w== Date: Fri, 9 Apr 2021 21:49:52 +0200 From: Marc Chantreux To: Zsh hackers list Subject: 2 new patches for _surfraw Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="cyb+gR++Vzd6KnEJ" Content-Disposition: inline X-Seq: 48445 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: --cyb+gR++Vzd6KnEJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline hello people, here are * one comply to good practices * one bugfix any review is warmly welcome. regards, marc --cyb+gR++Vzd6KnEJ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-pluralize-tags-in-_surfraw.patch" >From d6acd1c9bb02d77d5102f7319c327e9aec702e2f Mon Sep 17 00:00:00 2001 From: Marc Chantreux Date: Fri, 9 Apr 2021 21:44:54 +0200 Subject: [PATCH 1/2] pluralize tags in _surfraw --- Completion/Unix/Command/_surfraw | 44 +++++++++++++++++--------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/Completion/Unix/Command/_surfraw b/Completion/Unix/Command/_surfraw index 343d275cc..09852475e 100644 --- a/Completion/Unix/Command/_surfraw +++ b/Completion/Unix/Command/_surfraw @@ -20,11 +20,11 @@ case $state in subcmd) args=( '-help[display help information]' - '*:string:_guard "^-*" "search string"' + '*:strings:_guard "^-*" "search string"' ) case "$words[1]" in ask|cia|cnn|deblogs|excite|filesearching|foldoc|happypenguin|slashdot|slinuxdoc|sundocs|sunsolve|xxx) - _message -e string 'search string' + _message -e strings 'search string' ;; alioth) _arguments $args \ @@ -164,7 +164,7 @@ case $state in '-doc[view PTS documentation]' && ret=0 ;; debsec) - _message -e string 'package name, bug number or CVE ID' + _message -e strings 'package name, bug number or CVE ID' ;; deja) _arguments $args \ @@ -261,9 +261,9 @@ case $state in '-head=:display headlines:(on off)' \ '-grid=:show results in grid:(on off)' \ '-spell=:spelling tolerance:(off standard force)' \ - '*:dictionary word:->dictword' && ret=0 + '*:dictionary word:->words' && ret=0 - [[ "$state" = dictword ]] && _wanted words expl 'dictionary word' \ + [[ "$state" = words ]] && _wanted words expl 'dictionary word' \ compadd $(look "${PREFIX}") && ret=0 ;; netbsd|openbsd) @@ -422,27 +422,31 @@ case $state in '-results=-[specify number of results to return]:number' && ret=0 ;; yubnub) - _message -e command 'Yubnub Command' + _message -e commands 'Yubnub Command' ;; *) - _message -e string 'search string' + _message -e strings 'search string' ;; esac ;; elvi) - local -UT XDG_CONFIG_DIRS xcd - # as it starts with a space, the header becomes an empty - # string removed by the list expansion - _wanted elvi expl elvi compadd \ - ${${(f)"$(surfraw -elvi)"}%%[[:space:]]*} $( - # extract the keys of all bookmarks (should be in surfraw itself) - awk '{keys[$1]=1} END {for (k in keys) print k}' \ - $^xcd/surfraw/bookmarks(Nr) \ - /etc/xdg/surfraw/bookmarks(Nr) \ - /etc/surfraw.bookmarks(Nr) \ - ${XDG_CONFIG_HOME-${HOME?homeless}/.config}/surfraw/bookmarks(Nr) \ - ${HOME?homeless}/.surfraw.bookmarks(Nr) - ) && ret=0 + local -UT XDG_CONFIG_DIRS xdg_config_dirs + local it + # list the applets + set -- ${${(f)"$(_call_program elvi surfraw -elvi)"}%%[[:space:]]##-- *} + shift # the first line is an header: remove it + # then list the bookmarks + for it in \ + $^xdg_config_dirs/surfraw/bookmarks(Nr) \ + /etc/xdg/surfraw/bookmarks(Nr) \ + /etc/surfraw.bookmarks(Nr) \ + ${XDG_CONFIG_HOME-$HOME/.config}/surfraw/bookmarks(Nr) \ + $HOME/.surfraw.bookmarks(Nr) + do + read -d'\0' it < $it + set -- "$@" ${${(f)it}%%[[:space:]]*} + done + _wanted elvi expl elvi compadd "$@" && ret=0 ;; esac -- 2.30.2 --cyb+gR++Vzd6KnEJ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0002-fix-ebay-completion-bug-due-to-tailing-space.patch" >From 210a35e9512d3add59774c3012c4ebc241411e55 Mon Sep 17 00:00:00 2001 From: Marc Chantreux Date: Fri, 9 Apr 2021 21:45:40 +0200 Subject: [PATCH 2/2] fix ebay completion bug due to tailing space also removing all the other extra spaces --- Completion/Unix/Command/_surfraw | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Completion/Unix/Command/_surfraw b/Completion/Unix/Command/_surfraw index 09852475e..81f8d635f 100644 --- a/Completion/Unix/Command/_surfraw +++ b/Completion/Unix/Command/_surfraw @@ -165,7 +165,7 @@ case $state in ;; debsec) _message -e strings 'package name, bug number or CVE ID' - ;; + ;; deja) _arguments $args \ '-results=-:[number of results to return]' \ @@ -183,7 +183,7 @@ case $state in ;; ebay) _arguments $args \ - '-country=-:country:(com de uk fr)' \ + '-country=-:country:(com de uk fr)' \ '-results=-:[number of results to return]:number' && ret=0 ;; etym) @@ -233,7 +233,7 @@ case $state in '-title[search titles (default)]' '-author[search authors]' '-num[search etext numbers]' - ;; + ;; imdb) _arguments $args \ '-category=-:category:(All Titles MyMovies People Characters Quotes Bios Plots)' && ret=0 -- 2.30.2 --cyb+gR++Vzd6KnEJ--