From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11882 invoked by alias); 9 Jun 2018 17:36:21 -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: 42970 Received: (qmail 10094 invoked by uid 1010); 9 Jun 2018 17:36:21 -0000 X-Qmail-Scanner-Diagnostics: from mail-wm0-f66.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(74.125.82.66):SA:0(-1.9/5.0):. Processed in 2.138017 secs); 09 Jun 2018 17:36:21 -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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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=vY9aZ+HJ6oVMPpAxOt4FINpmwluowKbL8VmDl/o2aX8=; b=bGfLTLTi8Ty7s2gOcjWsFzWhr1afMGwRdqoQT1+bUNh7pg0gHU665XwNpcFktLG2z+ 986GqiQfFviIrafYpnCSPMvHKdtgYPENhzAuxFdjTxLmym0sKOy8uPpiRkhghTmKRgEG FTIruEfNIzdUwfHgyUqRFKvGRoqsg7E5hJl3ESKvOqpHWsjkwQX1uyC2V3spmZ8vcs4u eQTVjk8PwXMZdy1BKjC1/NyUr7ywZP3tATmOjYic92H50K5djjc3QCRMxW54BDXRGAqm eDEA9h58WSh3NPe3/je55C8xxV8IJjerNdaK+ky4HtTolCwhjkEW21bfAnzKwjpzp425 hJrw== 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=vY9aZ+HJ6oVMPpAxOt4FINpmwluowKbL8VmDl/o2aX8=; b=ZOvOzO31TeKjdzyMt9tphoo5YMrPAoFy96CpfmNrmLvGwzTcz73b1MjZ5EG6LtauRF Llsec31mKgWOAzQXMpa4iHQh0GMBLqUuzWbTcVc5LLjdJ0VBrYwHneJqVbMaeyT2JmP7 ALUF0Cf4sCR7t6hvbVZgh0tuYh9O8cEABJrheFHQKrL9JAc73iHUEFN0d0GLu0ir9hJP fah70XJwWf5o+HeEOpwGUG6RKIoyzq4p4da+PM/smKVncA0rg0GpU82RfB5381UMzfbg wFlHCF7MsHSoeqen6R8vlwtH/0PXii8GOEFV4RYCS6Usend4z4B3EeUGP0frUKMmE8d5 yLkg== X-Gm-Message-State: APt69E1fuyllk5g9HYV1u6eLbaHamCweXHL4uGfhBmRLszRkeOqD47I9 h8O0b4jGJCtMxzSnaVcGa52CDNse X-Google-Smtp-Source: ADUXVKJ8sMoCuEYVyJcKIsWfS04Aas3iY4NUOa7B9lfQ4qLzneZE/d04WnG809uPMXzf/07C10rR4g== X-Received: by 2002:a1c:64d7:: with SMTP id y206-v6mr4324635wmb.43.1528565775451; Sat, 09 Jun 2018 10:36:15 -0700 (PDT) Date: Sat, 9 Jun 2018 20:35:19 +0300 From: Doron Behar To: zsh-workers@zsh.org Subject: Re: [PATCH 1/1] Add completion for zathura. Message-ID: <20180609173519.q2qra4cv66u65uon@NUC.doronbehar.com> Mail-Followup-To: zsh-workers@zsh.org References: <20180608155331.2891-1-doron.behar@gmail.com> <20180608155331.2891-2-doron.behar@gmail.com> <24170.1528475324@thecus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <24170.1528475324@thecus> User-Agent: NeoMutt/20180512 On Fri, Jun 08, 2018 at 06:28:44PM +0200, Oliver Kiddle wrote: > doron.behar@gmail.com wrote: > > Thanks for this, I have some comments: > > > +(( $+functions[_zathura_files] )) || > > +_zathura_files(){ > > + for plugins_dir in "${opt_args[-p]}" "${opt_args[--plugins-dir]}" "/usr/lib/zathura"; do > > For my installation of zathura, this finds no plugins. Perhaps they are > compiled in. It handles at least PDF and PostScript. > I tried to get some clues as for this subject by digging into zathura's source code (https://git.pwmt.org/pwmt/zathura). Could you please tell me what are the files the `zathura` package (or what ever it's called) provided under your distribution? If there are no `.so` files for at least a PDF plugin, I'll put a fall-back here. > > + local files_regex="*.{${supported_filetypes[1]}," > > + for (( i = 2 ; i < ${#supported_filetypes[*]}; i ++)); do > > + files_regex="${files_regex}""${supported_filetypes[$i]}""," > > + done > > + files_regex="${files_regex}""${supported_filetypes[-1]}""}" > > + _files -g "${files_regex}" > > I think this can be simplified to avoid the loop when constructing the > file glob: > "*.(${(j.|.)supported_filetypes})(-.)" > That's smart but it doesn't work. Yet, after reading a little bit the documentation I've used this instead: _files -g "*.{${(j.,.)supported_filetypes}}(-.)" > > + > > +_arguments \ > > + {-e,--reparent=}'[Reparents to window specified by xid]:XID: ' \ > > As with your previous function, please stick to conventions on case for > descriptions: don't use uppercase for the first word. And don't put the > headings (like XID, PATH, NUMBER, PASSWORD) in block capitals. Got it, just like last time. I've prepared this contribution quite a long time ago and I forgot to fix these little things just like with `_luarocks` and more on the way... > > X IDs are completed by _x_window. Great. > > > > + {-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)' \ > > Remove the commas in the list. It is a space separated list when you > specify multiple options like that. > Got it. > > + {-x,--synctex-editor-command=}'[Set the synctex editor command]:COMMAND:_command' \ > > _command is the completer for the command reserved word so is not > applicable here. You probably want either _command_names -e or > _cmdstring. I think I'll use `_cmdstring` since it doesn't complete aliases of functions which probably wouldn't be interpreted properly by zathura. > > Oliver