zsh-users
 help / color / mirror / code / Atom feed
* imagemagick completes for all files
@ 2006-09-23 21:02 Philip
  2006-09-27  9:55 ` Oliver Kiddle
  0 siblings, 1 reply; 3+ messages in thread
From: Philip @ 2006-09-23 21:02 UTC (permalink / raw)
  To: zsh-users

Hi,

My imagemagick completion lists all files, not just images.

I looked at .../functions/Completion/Unix/_imagemagick, and these seem
to be the relevant lines:

> 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//:/|})(-.)'
>   return
> fi

and in _arguments:

> '*:picture file:_imagemagick'

I assumed the _files call was causing the problem, since 'format' doesn't
exist as a variable. But changing it to 'formats' didn't help, and nor did
taking it out of the quotes or removing the tilde.

I'm not sure what the (-.) means, but removing that doesn't help either,
and it doesn't seem to change the results I get from a manual glob.

The line as I currently have it is:

> _files "$@" "$expl[@]" -g '*.(#i)('${formats//:/|}')'

I've also confirmed that changing the file does have an effect when I
start a new shell, and that the _arguments line I quoted is the one
that's controlling the completion. So right now I'm somewhat stumped;
any help would be appreciated.

I'm using v4.2.5, from gentoo's repositories.


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

* Re: imagemagick completes for all files
  2006-09-23 21:02 imagemagick completes for all files Philip
@ 2006-09-27  9:55 ` Oliver Kiddle
  2006-09-27 13:19   ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Oliver Kiddle @ 2006-09-27  9:55 UTC (permalink / raw)
  To: Philip; +Cc: zsh-users

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
 


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

* Re: imagemagick completes for all files
  2006-09-27  9:55 ` Oliver Kiddle
@ 2006-09-27 13:19   ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2006-09-27 13:19 UTC (permalink / raw)
  To: zsh-users

Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
> 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.

Looks like this was already fixed in a slightly different but equivalent
way on the main line.  I've applied this to 4.2.
-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php


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

end of thread, other threads:[~2006-09-27 13:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-23 21:02 imagemagick completes for all files Philip
2006-09-27  9:55 ` Oliver Kiddle
2006-09-27 13:19   ` Peter Stephenson

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