From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28193 invoked by alias); 1 Jul 2018 17:11:35 -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: List-Unsubscribe: X-Seq: 43123 Received: (qmail 25223 invoked by uid 1010); 1 Jul 2018 17:11:35 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr0-f170.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.128.170):SA:0(-1.9/5.0):. Processed in 1.203843 secs); 01 Jul 2018 17:11:35 -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,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: doron.behar@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jA/wU5nA4BiEJGdL9RzPJwhyz9byInpwZ1whXxFl868=; b=T/emtQ7cq95n/DsqA9j7oFxBWephyikLofgcELjgkX9y+VPY4Ql3OLBloVgnmcRoj1 F3TZIb1zC7gMJJOAy4a8OPzG2CESrcZbrvUGIcg376ExEO+4+Li6kVeTOwA10l8AU8/w /HxgesAlpuAakqwB8WS+nPUzxee6OUSnVZkhPX+tLVDuxlYmUsF+Flaw1HaUUlcJX/ZW wZWR4FU+VyXJgkbMDESrrBoOirggA6OKgrKNXbWH7+r0EBwK4u5MrEWfsJcBmtZF88mj YcafPqsbLWDcHTP6rmGPXD4hsxSSP6yneDgxpUu8cFRF4aytMJ5/t3ySrFHfn6t6E7h2 sSlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=jA/wU5nA4BiEJGdL9RzPJwhyz9byInpwZ1whXxFl868=; b=UCfv5VV+Z6Feb5zNcm2ZZeKCeMvzpfu/9w0+AYa7rnUYdHBD+3+rgwBzcVAANvjYSQ p3nUq/qXKfNnS9mfbQGaaDW07IPFwihptqWBoMBdftFc56e5aCiH/cTpDxuLPjrLfnz1 QpZrkrQPh6YDuHCT3in0PR79/GiIaZmRPZ2/gs2HyWgHY/559CkwqJboNMEEF4k3xcMY B12OCKfrEtw3xbKDv/5l3W3S0Go+LxQ2waDDMIHQLU5LD9gn7HDUJ1aCkQkR7nIV70b+ 5vbWaYRc0hZHFM9mWWPNISO+QT5FPCEYrVyJ0eNtGy6bCfYwdayYtsermqFfjLUc5AQk 7/Mw== X-Gm-Message-State: APt69E3K5oiw7sB5g1YoaTGVAX/+UQG2i8JcNoVrrssRTkPm+WOTeO8C 8drC7eONIixxM1dT0RYUtkiUiKgu X-Google-Smtp-Source: AAOMgpcHwuQuVMvff7Qy1gfUbSc3R9nXTdCz65i3h52EtXqYLM5RQXzDcEAIDbkFYRiYrMJcTRbquw== X-Received: by 2002:adf:f086:: with SMTP id n6-v6mr6420849wro.49.1530465090297; Sun, 01 Jul 2018 10:11:30 -0700 (PDT) Date: Sun, 1 Jul 2018 20:11:58 +0300 From: Doron Behar To: zsh-workers@zsh.org Subject: Re: [PATCH] Add completion for zathura. Message-ID: <20180701171158.6uzs27ooafm4pk42@NUC.doronbehar.com> Mail-Followup-To: zsh-workers@zsh.org References: <20180613163152.28843-1-doron.behar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180613163152.28843-1-doron.behar@gmail.com> User-Agent: NeoMutt/20180622 Hey guys, just reminding you there's a patch here ready for your comments / merge. On Wed, Jun 13, 2018 at 07:31:52PM +0300, doron.behar@gmail.com wrote: > From: Doron Behar > > Make it aware of the plugins installed on the machine. > --- > Completion/Unix/Type/_pspdf | 2 +- > Completion/X/Command/_zathura | 45 +++++++++++++++++++++++++++++++++++ > 2 files changed, 46 insertions(+), 1 deletion(-) > create mode 100644 Completion/X/Command/_zathura > > diff --git a/Completion/Unix/Type/_pspdf b/Completion/Unix/Type/_pspdf > index 5bb8650b1..1df3f860c 100644 > --- a/Completion/Unix/Type/_pspdf > +++ b/Completion/Unix/Type/_pspdf > @@ -1,4 +1,4 @@ > -#compdef gsbj gsdj gsdj500 gslj gslp gsnd ps2ascii ghostview mgv pstoedit pstotgif zathura > +#compdef gsbj gsdj gsdj500 gslj gslp gsnd ps2ascii ghostview mgv pstoedit pstotgif > > local expl ext > > diff --git a/Completion/X/Command/_zathura b/Completion/X/Command/_zathura > new file mode 100644 > index 000000000..9116d2471 > --- /dev/null > +++ b/Completion/X/Command/_zathura > @@ -0,0 +1,45 @@ > +#compdef zathura > + > +(( $+functions[_zathura_files] )) || > +_zathura_files(){ > + local -a plugin_files > + for plugins_dir in "${opt_args[-p]}" "${opt_args[--plugins-dir]}" "/usr/lib/zathura" "/usr/local/lib/zathura" "/lib/zathura"; do > + plugin_files=(${plugins_dir}/*.so) > + if [[ -z "${plugin_files}" ]]; then > + break > + fi > + done > + if [[ -z "${plugin_files}" ]]; then > + _files -g "*.pdf(-.)" > + return > + fi > + local -a supported_filetypes > + for pf in "${plugin_files[@]}"; do > + if [[ $pf =~ "mupdf" ]]; then > + supported_filetypes+="pdf" > + supported_filetypes+="epub" > + supported_filetypes+="xps" > + elif [[ $pf =~ "poppler" ]]; then > + supported_filetypes+="pdf" > + else > + supported_filetypes+="${${pf%.so}#${plugins_dir}/lib}" > + fi > + done > + _files -g "*.(${(j.|.)supported_filetypes})(-.)" > +} > + > +_arguments \ > + {-e,--reparent=}'[Reparents to window specified by xid]:xid:_x_window' \ > + {-c,--config-dir=}'[Path to the config directory]:path:{_files -/}' \ > + {-d,--data-dir=}'[Path to the data directory]:path:{_files -/}' \ > + {-p,--plugins-dir=}'[Path to the directory containing plugins]:path:{_files -/}' \ > + {-w,--password=}"[The document's password]:password: " \ > + {-P,--page=}'[Opens the document at the given page number]:number: ' \ > + {-l,--log-level=}'[Set log level]:level:(debug info warning error)' \ > + {-x,--synctex-editor-command=}'[Set the synctex editor command]:command:_cmdstring' \ > + '--synctex-forward=[Jump to the given position]:input: ' \ > + '--synctex-pid=[Instead of looking for an instance having the correct file opened, try only the instance with the given PID]:pid:_pids' \ > + '--fork[Fork into background]' \ > + '(- :)--version[Display version string and exit]' \ > + '(- :)--help[Display help and exit]' \ > + '*:file:_zathura_files' > -- > 2.17.1 >