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

Re: PATCH: kfmclient and MIME type completion



Oliver Kiddle wrote:
> Peter wrote:
> 
> > +# This is the same style as used by zsh-mime-setup, with a different
> > +# context.
> > +if zstyle -a ":completion:${curcontext}:mime" mime-types type_files; then
> 
> Why do you use `mime' as the tag? It should either be empty or the same
> as the tag used when adding matches (such as mime-types).

It depends which part of the completion system you believe.  This was
an echo of the way it's done in zsh-mime-setup.  I do think it's cleaner
without a tag, though.

> > +[[ $state = *arg ]] || return 1
> > +
> > +# Argument to previous command.
> > +
> > +print $line >/tmp/tmp.out
> 
> That looks like remnant debug which we won't want.

I can see how you might think that.

Index: Completion/Unix/Type/_mime_types
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_mime_types,v
retrieving revision 1.1
diff -u -r1.1 _mime_types
--- Completion/Unix/Type/_mime_types	26 Jul 2004 16:59:54 -0000	1.1
+++ Completion/Unix/Type/_mime_types	27 Jul 2004 09:11:18 -0000
@@ -8,7 +8,7 @@
 
 # This is the same style as used by zsh-mime-setup, with a different
 # context.
-if zstyle -a ":completion:${curcontext}:mime" mime-types type_files; then
+if zstyle -a ":completion:${curcontext}:" mime-types type_files; then
   while (( (ind = ${type_files[(I)+]}) > 0 )); do
     type_files[$ind]=($default_type_files)
   done
@@ -31,12 +31,12 @@
   # Search for subtype.
   maintype=$match[1]
   compset -p $(( ${#maintype} + 1 ))
-  _wanted mimesubtype expl 'MIME subtype' \
+  _wanted mime-subtypes expl 'MIME subtype' \
       compadd -- $(sed -ne "s%^\(type=\|\)${maintype}/\([^ 	]*\).*$%\2%p" \
       $type_files)
 else
   # Search for main type.
-  _wanted mimetype expl 'MIME type' \
+  _wanted mime-types expl 'MIME type' \
     compadd -S/ -- $(sed -ne "s/^type=//" \
       -e "s%^\(${PREFIX:-[a-z]}[^=\"]*\)/.*$%\1%p" $type_files)
 fi
Index: Completion/X/Command/_kfmclient
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/X/Command/_kfmclient,v
retrieving revision 1.1
diff -u -r1.1 _kfmclient
--- Completion/X/Command/_kfmclient	26 Jul 2004 16:59:54 -0000	1.1
+++ Completion/X/Command/_kfmclient	27 Jul 2004 09:11:18 -0000
@@ -54,8 +54,6 @@
 
 # Argument to previous command.
 
-print $line >/tmp/tmp.out
-
 case $line[1] in
   (openURL)
   if [[ $state = secondarg ]]; then

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************



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