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 1264 invoked from network); 27 Feb 2021 15:28:09 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Feb 2021 15:28:09 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1614439689; b=fU1GTL4/SuLQIv9xgRj7sXoX1GdUqycVKxrrUrX7UJ2cv3wA6GBm5o/tbhmfOaj3DGqG+G9TgE VyW3XWe1UIsy9L4odlTVC309OvhjClQlgFwbJizFhZPvHmUY2lvE0W3EdukzcmZ0yroUWlKSwN cMh5VJoL99tBorSTHr4xbboav9Y99Q2dld3zSG5FqzSoct9EQGBVYNL+ISsfAJJRHpPkEh8JYx SLtrEUMaL3eNtJDuJ54BUTp43E6iK66ec7FcOKX1YFh+RF1GX23Fiu86MhEF/s6l2SutR67TT9 YkoqqJfkWxTJn23ZLf6+F3J8enPTND+t6j9BTwwiQO5caA==; 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=1614439689; bh=1ORwjtkL2SrjGOPHq49KMA2r4KQx3BPGuUjlZX/62eA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:Subject:To:From:Date:DKIM-Signature:DKIM-Signature; b=EFUYCtSENnqFePfx9+1Dx5whU4UQX6ssAKWmT8kwZUlTU8qHOV6O6727Zaq3sK1bqcmeFVd7R+ Hqr0e9cm5rj3QxjZPWNac9d6GJzicjKKlWGP3Ndk1w5unXA0AOEKjKPo/N7PQ0KekY7ED1zjx2 Xmqgt1KVRKNKgXae5sgWyg5QDTb6cLXjollOX0D4a3m8itejQQgcJGsMtyDbmJjAzr4uq3Wu+T +cWrXQzo1EYxAEPM90Uwq47RfrjNLDam3RMe3ljtqE0vnWv9q3Sn3tHGj3Jm+yVZo2ayHo1eyI 3DX9y9RcISbGAEC4LazEl3qEJ/o1trUjETM+8Snz8Ro6uw==; 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-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Subject:To:From:Date: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=Sf/nENz1h7ki/ch+KUjOFkuyemY6RL2X0FjbkGblIzM=; b=M9Ce8qgbrVvoS7RIXo52tFZGi8 j3Gs0DD1T1bxbXVy9i7zceLWTtvd1I/dcFyjcIvE/zk1MPnRgXkyfomKdqlkg4PKmcSZTI/GwiwUf 0e5Q8A4yWF8vQPVEKtax9HpQIm/9FKI+uHS1f+Ec9UbSO5mkcwKUzYmBJppLjg5KL2ExcP8MHM121 EpUwmx0Cf5MuJzxDYUgUS+H7lSU+L0IJQ1IeyrPS0vvMfx5ba2/EnzvvhaAuIFz+64slrCvJyumc3 4Rsq/jpFz13iGQI0F4o44qY6iFMdWfnmByGB4hUcZLORrkL0zRctHVxbO88efB22jlUQP5AOVmPlk Mz1ZyIsA==; Received: from authenticated user by zero.zsh.org with local id 1lG1Vo-0004Ik-8z; Sat, 27 Feb 2021 15:28:08 +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]:34218) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lG1VO-0003vv-L3; Sat, 27 Feb 2021 15:27:43 +0000 Received: from localhost (unknown [127.0.0.1]) by aurora-borealis.phear.org (Postfix) with ESMTP id 5D7D8FF07 for ; Sat, 27 Feb 2021 15:27:40 +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 jbnxSXY3rYyB for ; Sat, 27 Feb 2021 15:27:37 +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 316F0FF08 for ; Sat, 27 Feb 2021 15:27:37 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.10.3 aurora-borealis.phear.org 316F0FF08 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=phear.org; s=20180217; t=1614439657; bh=1ORwjtkL2SrjGOPHq49KMA2r4KQx3BPGuUjlZX/62eA=; h=Date:From:To:Subject:From; b=iS57IJPdklGSkAYHd9R+TNwHAOSLnEmLml1WDUwWB0mFD6XhGJWLj95XxFH8gUtzP /FgVpw1I5v0fOytkfi+F1slsz2GwN3URDdvhr9R8MykPxjTj3uqkGhm7w4G8vm3rSQ pvMdLyPTeIdgLFgOdsf+vvDfss/qHU8Cb2vWWbuDTokjpd4f0iP2V90voKD3hnsdEO Br6SxM1q9z6BGEJslPDQwTP3ClFPpKvdDoUSjVx8r6hyc7RrJYaca3kENj+xisjqPz 20g4cO6JknjsbgSrtbOrkMNrJtly5Hmhn6ZD1a3TYVmQ7sY072efX9Ny2BtA/oD5fH blMKxe3sKiZVg== Date: Sat, 27 Feb 2021 16:27:35 +0100 From: Marc Chantreux To: Zsh Users Subject: [PATCH] improve surfraw subcommands list Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="t1ECGGEsSfnUnvRt" Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Seq: 26557 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: --t1ECGGEsSfnUnvRt Content-Type: text/plain; charset=us-ascii; format=fixed Content-Disposition: inline hello people, i wrote this patch for the _surfraw completion, it * add bookmarks support * remove the header from the final list i don't know if it's good enough to be merged but bookmark support is very useful so this is my proposal. any review will be warmly welcome. regards, marc --- Completion/Unix/Command/_surfraw | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) --t1ECGGEsSfnUnvRt Content-Type: text/x-patch; charset=us-ascii; name="0001-improve-surfraw-subcommands-list.patch" Content-Disposition: attachment; filename="0001-improve-surfraw-subcommands-list.patch" Content-Transfer-Encoding: 8bit diff --git a/Completion/Unix/Command/_surfraw b/Completion/Unix/Command/_surfraw index f945f1ca9..343d275cc 100644 --- a/Completion/Unix/Command/_surfraw +++ b/Completion/Unix/Command/_surfraw @@ -424,12 +424,26 @@ case $state in yubnub) _message -e command 'Yubnub Command' ;; + *) + _message -e string '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)"$(_call_program elvi surfraw -elvi)"}%%[[:space:]]##--*}%:*} && ret=0 + ${${(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 ;; -esac +esac return ret --t1ECGGEsSfnUnvRt--