zsh-workers
 help / color / mirror / code / Atom feed
* [vincent@vinc17.org: Bug#269769: zsh: sabcmd completion doesn't work]
@ 2004-09-03 14:02 Clint Adams
  2004-09-03 15:11 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Clint Adams @ 2004-09-03 14:02 UTC (permalink / raw)
  To: zsh-workers

I get the same behavior.

----- Forwarded message from Vincent Lefevre <vincent@vinc17.org> -----

Date: Fri, 3 Sep 2004 14:05:59 +0200
From: Vincent Lefevre <vincent@vinc17.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Bug#269769: zsh: sabcmd completion doesn't work

Package: zsh
Version: 4.2.1-3
Severity: normal

zsh refuses to complete on stylesheet and XML filenames for sabcmd.
For instance:

$ zsh -f
greux% autoload -U compinit
greux% compinit
greux% ls
file1.xsl
greux% sabcmd [TAB]
file1.xsl

I just get the menu, but the completion doesn't work.

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.8
Locale: LANG=POSIX, LC_CTYPE=en_US.ISO8859-1

Versions of packages zsh depends on:
ii  debconf                     1.4.34       Debian configuration management sy
ii  libc6                       2.3.2.ds1-16 GNU C Library: Shared libraries an
ii  libcap1                     1:1.10-14    support for getting/setting POSIX.
ii  libncurses5                 5.4-4        Shared libraries for terminal hand
ii  passwd                      1:4.0.3-30   Change and administer password and

-- debconf information excluded

----- End forwarded message -----


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

* Re: [vincent@vinc17.org: Bug#269769: zsh: sabcmd completion doesn't work]
  2004-09-03 14:02 [vincent@vinc17.org: Bug#269769: zsh: sabcmd completion doesn't work] Clint Adams
@ 2004-09-03 15:11 ` Bart Schaefer
  2004-09-03 15:25   ` Oliver Kiddle
  2004-09-03 15:31   ` Clint Adams
  0 siblings, 2 replies; 5+ messages in thread
From: Bart Schaefer @ 2004-09-03 15:11 UTC (permalink / raw)
  To: Clint Adams; +Cc: zsh-workers

On Fri, 3 Sep 2004, Clint Adams wrote:

> I get the same behavior.

You can see why if you add this style:

zstyle ':completion:*' format 'Completing %d -'

schaefer<690> sabcmd
Completing parameter name -
Completing stylesheet -
file1.xsl

I don't immediately know why an empty group is being created for parameter
names even when there are no parameters to be completed.


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

* Re: [vincent@vinc17.org: Bug#269769: zsh: sabcmd completion doesn't work]
  2004-09-03 15:11 ` Bart Schaefer
@ 2004-09-03 15:25   ` Oliver Kiddle
  2004-09-03 15:33     ` Clint Adams
  2004-09-03 15:31   ` Clint Adams
  1 sibling, 1 reply; 5+ messages in thread
From: Oliver Kiddle @ 2004-09-03 15:25 UTC (permalink / raw)
  To: zsh-workers

Bart wrote:
> schaefer<690> sabcmd
> Completing parameter name -
> Completing stylesheet -
> file1.xsl
> 
> I don't immediately know why an empty group is being created for parameter
> names even when there are no parameters to be completed.

That's what the -e option to _message does. It means that you can add
parameters with the fake style and that the "parameter name" description
will be displayed even if no files match. It shouldn't be stopping the
filenames from being completed though and I'm not sure why it does.

Oliver


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

* Re: [vincent@vinc17.org: Bug#269769: zsh: sabcmd completion doesn't work]
  2004-09-03 15:11 ` Bart Schaefer
  2004-09-03 15:25   ` Oliver Kiddle
@ 2004-09-03 15:31   ` Clint Adams
  1 sibling, 0 replies; 5+ messages in thread
From: Clint Adams @ 2004-09-03 15:31 UTC (permalink / raw)
  To: zsh-workers; +Cc: 269769

> schaefer<690> sabcmd
> Completing parameter name -
> Completing stylesheet -
> file1.xsl
> 
> I don't immediately know why an empty group is being created for parameter
> names even when there are no parameters to be completed.

That's odd.  Judging by the manpage, it looks as though the stylesheet
should always be the first non-option argument, and the valid name=value
assignments need to be parsed from that.

I'm tempted to do the following.

Index: Completion/Unix/Command/_sablotron
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_sablotron,v
retrieving revision 1.2
diff -u -r1.2 _sablotron
--- Completion/Unix/Command/_sablotron	21 Jan 2004 13:53:29 -0000	1.2
+++ Completion/Unix/Command/_sablotron	3 Sep 2004 15:29:49 -0000
@@ -15,38 +15,4 @@
   $mopts{-c,--chain-xsl}'[single input file, multiple chained stylesheets]' \
   $mopts{-x,--batch-xml}'[single input file, multiple stylesheets]' \
   $mopts{-s,--batch-xsl}'[multiple input files, single stylesheet]' \
-  '*: :->arguments' && ret=0
-
-if [[ -n "$state" ]]; then
-  mode="${opt_args[(i)-c|--chain-xsl]:+chain}${opt_args[(i)-x|--batch-xml]:+batch-x}${opt_args[(i)-s|--batch-xsl]:+batch-s}"
-  [[ $mode = (chain|batch-[xs]) ]] || mode=default
-  _tags assignments files
-  while _tags; do
-    if _requested assignments; then
-      if [[ -prefix *= ]]; then
-        _message -e value value
-      else
-        _message -e parameter 'parameter name'
-      fi
-    fi
-    if _requested files; then
-      case $mode:${#words[1,CURRENT-1]:#(-*|*=*)}; in
-        default:1|chain:<3->|batch-x:2|batch-s:1)
-	  _description files expl stylesheet
-	  _files "$expl[@]" -g "*.xsl(-.)" && ret=0
-	;;
-        default:2|chain:1|batch-x:1|batch-s:2)
-	  _description files expl 'input file'
-	  _files "$expl[@]" && ret=0
-	;;
-        default:3|chain:2|batch-x:<3->|batch-s:<3->)
-	  _description files expl 'output file'
-	  _files "$expl[@]" && ret=0
-	;;
-      esac
-    fi
-    (( ret )) || break
-  done
-fi
-
-return ret
+  ':::_files -g "*.xsl"' && ret=0


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

* Re: [vincent@vinc17.org: Bug#269769: zsh: sabcmd completion doesn't work]
  2004-09-03 15:25   ` Oliver Kiddle
@ 2004-09-03 15:33     ` Clint Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Clint Adams @ 2004-09-03 15:33 UTC (permalink / raw)
  To: Oliver Kiddle; +Cc: zsh-workers, 269769

> That's what the -e option to _message does. It means that you can add
> parameters with the fake style and that the "parameter name" description
> will be displayed even if no files match. It shouldn't be stopping the
> filenames from being completed though and I'm not sure why it does.

Ah; maybe we can complete *.xsl as first non-option argument until that
gets figured out?


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

end of thread, other threads:[~2004-09-03 15:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-03 14:02 [vincent@vinc17.org: Bug#269769: zsh: sabcmd completion doesn't work] Clint Adams
2004-09-03 15:11 ` Bart Schaefer
2004-09-03 15:25   ` Oliver Kiddle
2004-09-03 15:33     ` Clint Adams
2004-09-03 15:31   ` 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).