zsh-workers
 help / color / mirror / code / Atom feed
* Add .tif as valid extension for TIFF files in _imagemagick, _graphicsmagick, _okular
@ 2016-09-07 17:48 Antony Lee
  2016-09-11 14:32 ` Oliver Kiddle
  0 siblings, 1 reply; 2+ messages in thread
From: Antony Lee @ 2016-09-07 17:48 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 606 bytes --]

Hi,

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 have checked that the underlying utilities do recognize .tif as an
extension, so could it be added to the respective completers?  Another
completer which may be enhanced is the `-exportlanguage` flag in `X/_xfig`
but I have not checked that xfig does actually suppport ".tif" instead of
".tiff".

Thanks,

Antony

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Add .tif as valid extension for TIFF files in _imagemagick, _graphicsmagick, _okular
  2016-09-07 17:48 Add .tif as valid extension for TIFF files in _imagemagick, _graphicsmagick, _okular Antony Lee
@ 2016-09-11 14:32 ` Oliver Kiddle
  0 siblings, 0 replies; 2+ messages in thread
From: Oliver Kiddle @ 2016-09-11 14:32 UTC (permalink / raw)
  To: Antony Lee; +Cc: zsh-workers

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-12  1:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-07 17:48 Add .tif as valid extension for TIFF files in _imagemagick, _graphicsmagick, _okular Antony Lee
2016-09-11 14:32 ` Oliver Kiddle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).