zsh-workers
 help / color / mirror / code / Atom feed
* Re: Bug#434879: zsh: Incorrect completion after "dvips -Ppdf "
       [not found] <20070727133050.GA7151@vin.lip.ens-lyon.fr>
@ 2007-07-27 15:16 ` Clint Adams
  2007-07-27 20:49   ` Vincent Lefevre
  0 siblings, 1 reply; 6+ messages in thread
From: Clint Adams @ 2007-07-27 15:16 UTC (permalink / raw)
  To: Vincent Lefevre, 434879; +Cc: zsh-workers

On Fri, Jul 27, 2007 at 03:30:50PM +0200, Vincent Lefevre wrote:
> If I type "dvips -P pdf " then [Tab], the completion works as expected.
> But if I type "dvips -Ppdf " then [Tab], zsh wants to complete on the
> printer name.

Is it impossible to string option letters together with dvips?


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

* Re: Bug#434879: zsh: Incorrect completion after "dvips -Ppdf "
  2007-07-27 15:16 ` Bug#434879: zsh: Incorrect completion after "dvips -Ppdf " Clint Adams
@ 2007-07-27 20:49   ` Vincent Lefevre
  2007-07-27 21:25     ` Clint Adams
  2007-07-29 11:26     ` Clint Adams
  0 siblings, 2 replies; 6+ messages in thread
From: Vincent Lefevre @ 2007-07-27 20:49 UTC (permalink / raw)
  To: 434879, zsh-workers

On 2007-07-27 11:16:02 -0400, Clint Adams wrote:
> On Fri, Jul 27, 2007 at 03:30:50PM +0200, Vincent Lefevre wrote:
> > If I type "dvips -P pdf " then [Tab], the completion works as expected.
> > But if I type "dvips -Ppdf " then [Tab], zsh wants to complete on the
> > printer name.
> 
> Is it impossible to string option letters together with dvips?

I don't understand your question. If you mean grouping options in a
single argument, this doesn't seem to be possible. But dvips behaves
strangely:

vin% dvips -w
dvips: ! Invalid option `-w'. Try --help for more information.
vin% dvips -j
This is dvips(k) 5.96.1 Copyright 2007 Radical Eye Software (www.radicaleye.com)
Missing DVI file argument (or -f).
Try --help for more information.
vin% dvips -jw
This is dvips(k) 5.96.1 Copyright 2007 Radical Eye Software (www.radicaleye.com)
Missing DVI file argument (or -f).
Try --help for more information.
vin% dvips -wj
dvips: ! Invalid option `-wj'. Try --help for more information.

I'd say that when an option doesn't take data, the trailing characters
of the argument are simply ignored.

BTW, there are other problems with the completion code. For instance,

  dvips -j [Tab]

gives:

  dvips -j -

then completes options. "dvips -j [Tab]" should complete dvi files.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)


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

* Re: Bug#434879: zsh: Incorrect completion after "dvips -Ppdf "
  2007-07-27 20:49   ` Vincent Lefevre
@ 2007-07-27 21:25     ` Clint Adams
  2007-07-28  9:56       ` Vincent Lefevre
  2007-07-29 11:26     ` Clint Adams
  1 sibling, 1 reply; 6+ messages in thread
From: Clint Adams @ 2007-07-27 21:25 UTC (permalink / raw)
  To: 434879, zsh-workers

On Fri, Jul 27, 2007 at 10:49:29PM +0200, Vincent Lefevre wrote:
> I don't understand your question. If you mean grouping options in a
> single argument, this doesn't seem to be possible. But dvips behaves
> strangely:

Try changing "_arguments -s" to "arguments -s -w".  That might do the
right thing, though I'm still not clear on how dvips parses the command
line.

> I'd say that when an option doesn't take data, the trailing characters
> of the argument are simply ignored.
> 
> BTW, there are other problems with the completion code. For instance,
> 
>   dvips -j [Tab]
> 
> gives:
> 
>   dvips -j -
> 
> then completes options. "dvips -j [Tab]" should complete dvi files.

That should be an easy fix:

Index: Completion/Unix/Command/_dvi
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_dvi,v
retrieving revision 1.2
diff -u -r1.2 _dvi
--- Completion/Unix/Command/_dvi	21 Jan 2004 13:53:29 -0000	1.2
+++ Completion/Unix/Command/_dvi	27 Jul 2007 21:23:19 -0000
@@ -26,6 +26,7 @@
     '-F[append control-D]' \
     '-h[specify additional header file]:postscript header file:_files -g "*.(#i)(ps|eps)(-.)"' \
     '-i[one file per section]' \
+    '-j[download fonts partially]' \
     '-k[print crop marks]' \
     '-K[include postscript comments]' \
     '(-pp)-l[specify last page to print]:number of last page' \


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

* Re: Bug#434879: zsh: Incorrect completion after "dvips -Ppdf "
  2007-07-27 21:25     ` Clint Adams
@ 2007-07-28  9:56       ` Vincent Lefevre
  2007-07-29 14:42         ` Clint Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Vincent Lefevre @ 2007-07-28  9:56 UTC (permalink / raw)
  To: 434879, zsh-workers

On 2007-07-27 17:25:41 -0400, Clint Adams wrote:
> On Fri, Jul 27, 2007 at 10:49:29PM +0200, Vincent Lefevre wrote:
> > I don't understand your question. If you mean grouping options in a
> > single argument, this doesn't seem to be possible. But dvips behaves
> > strangely:
> 
> Try changing "_arguments -s" to "arguments -s -w".  That might do the
> right thing, though I'm still not clear on how dvips parses the command
> line.

I've tried "_arguments -s -w", but this is even worse.

Both "dvips -P[Tab]" and "dvips -P [Tab]" should complete on the
printer names, but "dvips -Pfoo" and "dvips -P foo" should complete
on the dvi files (or another option).

"dvips -j[Tab]" should add a space, because the -j option doesn't
take any data.

"dvips -j [Tab]" should complete on the dvi files (or another option).

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)


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

* Re: Bug#434879: zsh: Incorrect completion after "dvips -Ppdf "
  2007-07-27 20:49   ` Vincent Lefevre
  2007-07-27 21:25     ` Clint Adams
@ 2007-07-29 11:26     ` Clint Adams
  1 sibling, 0 replies; 6+ messages in thread
From: Clint Adams @ 2007-07-29 11:26 UTC (permalink / raw)
  To: 434879, zsh-workers

On Fri, Jul 27, 2007 at 10:49:29PM +0200, Vincent Lefevre wrote:
> I don't understand your question. If you mean grouping options in a
> single argument, this doesn't seem to be possible. But dvips behaves
> strangely:

In that case,

Index: Completion/Unix/Command/_dvi
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_dvi,v
retrieving revision 1.4
diff -u -r1.4 _dvi
--- Completion/Unix/Command/_dvi	28 Jul 2007 07:03:47 -0000	1.4
+++ Completion/Unix/Command/_dvi	29 Jul 2007 11:25:03 -0000
@@ -11,7 +11,7 @@
 
 case "$service" in
 dvips)
-  _arguments -s \
+  _arguments \
     '-a[make three passes]' \
     '(-B)-A[print only odd numbered pages]' \
     '(-A)-B[print only even numbered pages]' \


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

* Re: Bug#434879: zsh: Incorrect completion after "dvips -Ppdf "
  2007-07-28  9:56       ` Vincent Lefevre
@ 2007-07-29 14:42         ` Clint Adams
  0 siblings, 0 replies; 6+ messages in thread
From: Clint Adams @ 2007-07-29 14:42 UTC (permalink / raw)
  To: 434879, zsh-workers

On Sat, Jul 28, 2007 at 11:56:54AM +0200, Vincent Lefevre wrote:
> Both "dvips -P[Tab]" and "dvips -P [Tab]" should complete on the
> printer names, but "dvips -Pfoo" and "dvips -P foo" should complete
> on the dvi files (or another option).

Er, and

Index: Completion/Unix/Command/_dvi
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_dvi,v
retrieving revision 1.5
diff -u -r1.5 _dvi
--- Completion/Unix/Command/_dvi	29 Jul 2007 11:39:43 -0000	1.5
+++ Completion/Unix/Command/_dvi	29 Jul 2007 14:41:23 -0000
@@ -39,7 +39,7 @@
     '-O[specify offset of origin]:offset of origin (<x>,<y>)' \
     '(-p -l -n)-pp[specify which pages to print]:list of pages or ranges to print:' \
     '(-pp)-p[specify first page to print]:number of first page' \
-    '-P[specify printer]:printer name' \
+    '-P+[specify printer]:printer name' \
     '-q[quiet operation]' \
     '-r[reverse order of pages]' \
     '-R[run securely]' \


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

end of thread, other threads:[~2007-07-29 14:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20070727133050.GA7151@vin.lip.ens-lyon.fr>
2007-07-27 15:16 ` Bug#434879: zsh: Incorrect completion after "dvips -Ppdf " Clint Adams
2007-07-27 20:49   ` Vincent Lefevre
2007-07-27 21:25     ` Clint Adams
2007-07-28  9:56       ` Vincent Lefevre
2007-07-29 14:42         ` Clint Adams
2007-07-29 11:26     ` Clint Adams

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