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

Re: imagemagick completes for all files



On 23 Sep, Philip wrote:
> My imagemagick completion lists all files, not just images.

Looks like it has been broken for a long time.

> I'm not sure what the (-.) means, but removing that doesn't help either,

It limits the glob to filenames so you would need to have a directory
with a .jpeg extension or something before you'd notice a difference.

You correctly identified the lines causing the problems. The patch below
fixes it for me. Hopefully this applies cleanly against the latest CVS.
I've using whatever comes with Solaris 10 here.

Oliver

--- /usr/sfw/share/zsh/4.2.1/functions/Completion/Unix/_imagemagick	Sat Jan  8 11:43:08 2005
+++ /home/okiddle/.zfunc/_imagemagick	Wed Sep 27 11:49:09 2006
@@ -14,7 +14,7 @@
 formats=jpg:jpeg: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:xwd:xbm:xpm:yuv
 
 if (( $# )); then
-  _files "$@" "$expl[@]" -g '*.(#i)(${~format//:/|})(-.)'
+  _files -g "*.(#i)(${~formats//:/|})(-.)" "$@"
   return
 fi
 



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