Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH 1/1] Add completion for zathura.



On 9 Jun, Doron Behar wrote:
> 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.

The file list is here:
https://koji.fedoraproject.org/koji/rpminfo?rpmID=4869616
That's a zathura 0.2.7 build for RHEL 7 which is perhaps somewhat old.

I would strongly suggest putting a fallback in for at least *.pdf.
You never know when some overly clever logic is going to fail.

> 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}}(-.)"

I'd suggest sticking to pattern characters like (...|...) over brace
expansion in the parameter to _files -g. If braces are working, it is by
accident rather than design.

> > 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.

_cmdstring handled a quoted command-line where you might have arguments
to the command. Judging from the example in the documentation, that is
appropriate in this case.

Oliver



Messages sorted by: Reverse Date, Date, Thread, Author