Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: _ps, _pdf and _pspdf.
- X-seq: zsh-workers 7418
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: PATCH: _ps, _pdf and _pspdf.
- Date: Wed, 11 Aug 1999 12:54:02 +0200 (MET DST)
- In-reply-to: Tanaka Akira's message of 11 Aug 1999 18:33:57 +0900
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Tanaka Akira wrote:
> This is _ps, _pdf update and new _pspdf.
>
> * _ps didn't require a dot before suffix.
> * I think pstruct is not related to postscript. At least, pstruct in perl is so.
Right, I was had a self-written tool named pstruct, sorry that that
slipped in.
> * More commands. (gs, psutils, xpdf, etc.)
> * Some commands based on gs accept files both ps and pdf.
>
> ...
>
> +#compdef acroread pdf2dsc pdf2ps pdfimages pdfinfo pdftopbm pdftops pdftotext xpdf
Ah, the pbm stuff...
This is a first simple solution. Now I'm thinking aabout chaging the
uses of _compskip so that one can say `do not try any other completion
function' (like we have it now), but can also say `use a completion
function defined for the command itself, but don't use -default-'.
Then we can give some of these commands their own functions, too.
Bye
Sven
diff -u oc/User/_pbm Completion/User/_pbm
--- oc/User/_pbm Wed Aug 11 12:48:14 1999
+++ Completion/User/_pbm Wed Aug 11 12:46:12 1999
@@ -0,0 +1,13 @@
+#compdef -p p[bgpn]m*
+
+local pat
+
+_compskip=1
+
+if [[ "$words[1]" = pnm* ]]; then
+ pat='*.(#i)p[bgp]m'
+else
+ pat="*.(#i)${words[1][1,3]}"
+fi
+
+_path_files -g "$pat" || _files -g '*.(#i)p[bgp]m'
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author