zsh-users
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Marc Chantreux <eiro@phear.org>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: [PATCH] improve surfraw subcommands list
Date: Mon, 1 Mar 2021 15:23:44 +0000	[thread overview]
Message-ID: <20210301152344.GA18578@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <YDpk58wVLfg8EpHF@prometheus.u-strasbg.fr>

Marc Chantreux wrote on Sat, Feb 27, 2021 at 16:27:35 +0100:
> 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

Don't play golf.  Name it «xdg_config_dirs».

> +    # as it starts with a space, the header becomes an empty
> +    # string removed by the list expansion

What?  Does "the header" mean the first line of the output?

>      _wanted elvi expl elvi compadd \
> -      ${${${(f)"$(_call_program elvi surfraw -elvi)"}%%[[:space:]]##--*}%:*} && ret=0
> +        ${${(f)"$(surfraw -elvi)"}%%[[:space:]]*} $(

Restore _call_program.

> +          # extract the keys of all bookmarks (should be in surfraw itself)
> +          awk '{keys[$1]=1} END {for (k in keys) print k}' \

Use a parameter expansion rather than an external dependency and a fork,
if possible.  If there's a reason to make an exception, it's not clear
to me.

> +          $^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)

There shouldn't be an error message here at all, certainly not such
a brief one.

> 

Please use proper capitalization in your written English.

> +        ) && ret=0
>    ;;
> -esac  
> +esac
>  
>  return ret



  reply	other threads:[~2021-03-01 15:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-27 15:27 Marc Chantreux
2021-03-01 15:23 ` Daniel Shahaf [this message]
2021-03-11 18:08   ` Marc Chantreux
2021-03-20  1:35     ` Lawrence Velázquez
2021-03-27 16:17       ` Lawrence Velázquez
2021-04-03 15:59         ` Lawrence Velázquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210301152344.GA18578@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=eiro@phear.org \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).