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

Re: Add .tif as valid extension for TIFF files in _imagemagick, _graphicsmagick, _okular



On 7 Sep, Antony Lee wrote:
> Currently, the Unix/_imagemagick, Unix/_graphicsmagic and X/_okular
> completers only recognize .tiff, but not .tif, as the extension of a TIFF
> file (the latter is common for files generated on Windows due to 8.3
> filenames).  Compare with X/_{gqview,xv} which do recognize .tif as well.

I don't have xifg installed either so haven't verified that. Otherwise,
the following should handle it.

Oliver

diff --git a/Completion/Unix/Command/_graphicsmagick b/Completion/Unix/Command/_graphicsmagick
index 9306acd..150f5ae 100644
--- a/Completion/Unix/Command/_graphicsmagick
+++ b/Completion/Unix/Command/_graphicsmagick
@@ -3,7 +3,7 @@
 local state line expl formats curcontext="$curcontext"
 typeset -A opt_args
 
-formats=jpg:jpeg:jp2:j2k:jpc:jpx:jpf:tiff:miff:ras:bmp:cgm:dcx:ps:eps:fig:fits:fpx:gif:mpeg:pbm:pgm:ppm:pcd:pcl:pdf:pcx:png:rad:rgb:rgba:rle:sgi:html:shtml:tga:ttf:uil:xcf:xwd:xbm:xpm:yuv
+formats=jpg:jpeg:jp2:j2k:jpc:jpx:jpf:tif:tiff:miff:ras:bmp:cgm:dcx:ps:eps:fig:fits:fpx:gif:mpeg:pbm:pgm:ppm:pcd:pcl:pdf:pcx:png:rad:rgb:rgba:rle:sgi:html:shtml:tga:ttf:uil:xcf:xwd:xbm:xpm:yuv
 
 if (( $# )); then
   _files "$@" -g "*.(#i)(${~formats//:/|})(-.)"
diff --git a/Completion/Unix/Command/_imagemagick b/Completion/Unix/Command/_imagemagick
index 1fc6089..4a9b62a 100644
--- a/Completion/Unix/Command/_imagemagick
+++ b/Completion/Unix/Command/_imagemagick
@@ -12,7 +12,7 @@ typeset -A opt_args
 #
 # and certainly many other things...
 
-formats=(jpg jpeg jp2 j2k jpc jpx jpf tiff miff ras bmp cgm dcx ps eps fig fits fpx gif mpeg pbm pgm ppm pcd pcl pdf pcx png rad rgb rgba rle sgi html shtml tga ttf uil xcf xwd xbm xpm yuv)
+formats=(jpg jpeg jp2 j2k jpc jpx jpf tif tiff miff ras bmp cgm dcx ps eps fig fits fpx gif mpeg pbm pgm ppm pcd pcl pdf pcx png rad rgb rgba rle sgi html shtml tga ttf uil xcf xwd xbm xpm yuv)
 
 if (( $# )); then
   _files "$@" -g "*.(#i)(${(j:|:)formats})(-.)"
diff --git a/Completion/X/Command/_okular b/Completion/X/Command/_okular
index bfdb4de..f08f81c 100644
--- a/Completion/X/Command/_okular
+++ b/Completion/X/Command/_okular
@@ -1,10 +1,10 @@
 #compdef okular
 local extns
 
-extns="{pdf,ps,eps,dvi}(.gz|.bz2)(#c,1)|djvu|tiff|chm|cbr|cbz"
+extns="(pdf|ps|eps|dvi)(|.gz|.bz2)|djvu|tif|tiff|chm|cbr|cbz"
 
 _arguments \
   '(-p --page)'{-p,--page}'[page of the document to be shown]:page: ' \
   '--presentation[start the document in presentation mode]' \
   '--unique[unique instance control]' \
-  "*:Okular documents:_files -g '*.(#i)($extns)(-.)'"
+  "*:okular document:_files -g '*.(#i)($extns)(-.)'"



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