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

Re: zathura conpletion for zsh broken



Leah Neukirchen wrote on Wed, 26 Sep 2018 23:08 +0200:
> Oliver Freyermuth <o.freyermuth@xxxxxxxxxxxxxx> writes:
> 
> > Am 25.09.18 um 21:21 schrieb Daniel Shahaf:
> >> Oliver Freyermuth wrote on Tue, Sep 25, 2018 at 17:14:04 +0200:
> >>> +++ b/Completion/X/Command/_zathura
> >>> @@ -25,7 +25,7 @@ _zathura_files(){
> >>>      elif [[ $pf =~ "poppler" ]]; then
> >>>        supported_filetypes+="pdf"
> >>>      else
> >>> -      supported_filetypes+="${${pf%.so}#${plugins_dir}/lib}"
> >>> +      supported_filetypes+="${${pf%.so}#${plugins_dir}/}"
> >> 
> >> Isn't this equivalent to «supported_filetypes+=${pf:t:r}»?
> >
> > Indeed, it is, and that would be much easier. 
> 
> Hm, on my system (Void Linux with zathura-pdf-mupdf 0.3.3 and meson
> build) the files are called
> 
> /usr/lib/zathura/libdjvu.so
> /usr/lib/zathura/libpdf-mupdf.so
> /usr/lib/zathura/libps.so
> 

I'm on Debian and I have /usr/lib/zathura/{djvu,pdf,ps}.so.

> So the lib-stripping seems to make sense?

Patch attached.

Thanks,

Daniel
From 094fef6e8fa9895c59ddd58e2a1f4492cefdf463 Mon Sep 17 00:00:00 2001
From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
Date: Thu, 27 Sep 2018 18:20:19 +0000
Subject: [PATCH] Teach _zathura to support both naming conventions of
 /usr/lib/zathura/*.so modules.

---
 Completion/X/Command/_zathura | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Completion/X/Command/_zathura b/Completion/X/Command/_zathura
index 615488068..9c26910d8 100644
--- a/Completion/X/Command/_zathura
+++ b/Completion/X/Command/_zathura
@@ -24,7 +24,9 @@ _zathura_files(){
     elif [[ $pf =~ "poppler" ]]; then
       supported_filetypes+="pdf"
     else
+      # Some systems have /usr/lib/zathura/djvu.so, others have /usr/lib/zathura/libdjvu.so.
       supported_filetypes+="${pf:t:r}"
+      supported_filetypes+="${${pf:t:r}#lib}"
     fi
   done
   _files -g "*.(${(j.|.)${(@u)supported_filetypes}})(-.)"


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