From e1f02ea95889ba747c80efd5837b402c63c19c8e Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Sat, 5 Sep 2015 00:01:30 +0200 Subject: [PATCH] zsh: Update Lookup functions from upstream This adds the -G option to the gmane backend and fixes a syntax error in the usenet backend --- usr_share_grml/zsh/functions/Lookup/Backends/LOOKUP_be_gmane | 10 +++++++++- usr_share_grml/zsh/functions/Lookup/Backends/LOOKUP_be_usenet | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/usr_share_grml/zsh/functions/Lookup/Backends/LOOKUP_be_gmane b/usr_share_grml/zsh/functions/Lookup/Backends/LOOKUP_be_gmane index bda727d..f2d1e7d 100644 --- a/usr_share_grml/zsh/functions/Lookup/Backends/LOOKUP_be_gmane +++ b/usr_share_grml/zsh/functions/Lookup/Backends/LOOKUP_be_gmane @@ -31,6 +31,8 @@ function LOOKUP_help_${backend}() { # gmane backend help {{{ LOOKUP_guard || return 1 printf 'usage: %s \n' ${backend} + printf ' -G Open group (like gmane.emacs.orgmode) in gmane'\''s browser mode\n' + printf ' Completion will offer bookmarked groups.\n' printf ' -l search for original list names (like zsh-workers)\n' printf ' -s match gmane group names (like comp.shell)\n' printf ' -L list-mode; do not open a browser, just print the results\n' @@ -73,6 +75,7 @@ function LOOKUP_help_${backend}() { printf ' %% lookup %s -g gmane.comp.shells.fish.user zsh\n' ${backend} printf ' %% lookup %s -L -l zsh-workers\n' ${backend} printf ' %% lookup %s -L -s openbsd\n' ${backend} + printf ' %% lookup %s -G gmane.emacs.orgmode\n' ${backend} #}}} } LOOKUP_help && return 0 @@ -116,6 +119,7 @@ if [[ -n ${lookup_complete} ]] ; then } comp_args=( + '-G[browse gmane group]:group name:__lookup_'${backend}'_group_bookmarks' '-l[search for original list names]:list name:' '-s[match gmane group names]:group name:' '-L[switch to list-mode]' @@ -143,6 +147,7 @@ zstyle -s "${lookup_context}" default-oper operation || operation='and' # parse options lu_parseopts_args=( + G bool l bool m bool s bool @@ -245,7 +250,10 @@ function LOOKUP_beh_${backend}_list() { # make the actual queries LOOKUP_encode -q -if [[ ${opts[-l]} == 'yes' ]] ; then +if [[ ${opts[-G]} == 'yes' ]] ; then + LOOKUP_browser "http://news.gmane.org/${QUERY}" + ret="$?" +elif [[ ${opts[-l]} == 'yes' ]] ; then if [[ ${list_mode} == 'yes' ]] ; then LOOKUP_beh_${backend}_list 'list' ${QUERY} ret="$?" diff --git a/usr_share_grml/zsh/functions/Lookup/Backends/LOOKUP_be_usenet b/usr_share_grml/zsh/functions/Lookup/Backends/LOOKUP_be_usenet index f092041..b449513 100644 --- a/usr_share_grml/zsh/functions/Lookup/Backends/LOOKUP_be_usenet +++ b/usr_share_grml/zsh/functions/Lookup/Backends/LOOKUP_be_usenet @@ -75,7 +75,7 @@ if [[ -z ${mode} ]] ; then if [[ mode == 'author' ]] && [[ -z ${author} ]] ; then local a zstyle -s "${lookup_context}" default-author a || a='Joe User' - author="&as_uauthors=$(LOOKUP_encode $a})" + author="&as_uauthors=$(LOOKUP_encode $a)" fi fi -- 2.1.4