zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@berkom.de>
To: zsh-workers@sunsite.dk
Subject: Re: tag-order problem
Date: Tue, 14 May 2002 10:06:12 +0200	[thread overview]
Message-ID: <15584.50548.695771.69768@wischnow.berkom.de> (raw)
In-Reply-To: <1021114086.27414.10.camel@localhost.localdomain>


Borsenkow Andrej wrote:

> Just found problem in my _service/_services
> 
> _service calls _services to complete list of available services. Because
> _services normally completes both init and xinetd, I presumed I could
> limit matches by setting tag-order; in this case:
> 
> zstyle :completion::complete:service:argument-1: tag-order init -
> 
> (meaning - for the first argument of service somplete only tag `init').
> 
> It did restrict services set to init only - but it also stopped dead
> options completion.
> 
> Setting tags to `options init -' does allow options completion - both in
> first and second word as well; [...]

First, there was a buglet in _arguments that made option completion
use a context name containing the `argument-1'. Then there was a
buglet in _services because the loop wasn't left when completions were
produced. That's the reason why it didn't do what it should without
the `-' in tag-order.

With the two fixes it now works nicely for me (without `-').


Bye
  Sven

Index: Completion/Base/Utility/_arguments
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_arguments,v
retrieving revision 1.11
diff -u -r1.11 _arguments
--- Completion/Base/Utility/_arguments	18 Feb 2002 14:27:38 -0000	1.11
+++ Completion/Base/Utility/_arguments	14 May 2002 08:03:32 -0000
@@ -335,9 +335,11 @@
          [[ -z "$hasopts" &&
             -z "$matched" &&
             ( -z "$aret" || "$PREFIX" = "$origpre" ) ]] &&
-          { ! zstyle -T ":completion:${curcontext}:options" prefix-needed ||
+          { ! zstyle -T ":completion:${oldcontext%:*}:options" prefix-needed ||
             [[ "$origpre" = [-+]* || -z "$aret$mesg$tried" ]] } ; then
-	local prevpre="$PREFIX" previpre="$IPREFIX"
+	local prevpre="$PREFIX" previpre="$IPREFIX" prevcontext="$curcontext"
+
+        curcontext="${oldcontext%:*}:options"
 
 	hasopts=yes
 
@@ -389,6 +391,7 @@
         fi
 	PREFIX="$prevpre"
 	IPREFIX="$previpre"
+        curcontext="$prevcontext"
       fi
       [[ -n "$tried" && "${${alwopt:+$origpre}:-$PREFIX}" != [-+]* ]] && break
     done
Index: Completion/Unix/Type/_services
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_services,v
retrieving revision 1.1
diff -u -r1.1 _services
--- Completion/Unix/Type/_services	8 May 2002 09:18:13 -0000	1.1
+++ Completion/Unix/Type/_services	14 May 2002 08:03:32 -0000
@@ -18,6 +18,7 @@
     compadd  -a inits && ret=0
   _requested xinetd expl 'xinetd services' \
     compadd  -a xinetds && ret=0
+  (( ret )) || break
 done
 
 return $ret

-- 
Sven Wischnowsky                          wischnow@berkom.de


  parent reply	other threads:[~2002-05-14  8:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-11 10:48 Borsenkow Andrej
2002-05-13  9:09 ` Sven Wischnowsky
2002-05-14  8:06 ` Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-05-30 14:22 Tanaka Akira
2000-05-30 17:12 ` Bart Schaefer
2000-05-10 16:56 Tanaka Akira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15584.50548.695771.69768@wischnow.berkom.de \
    --to=wischnow@berkom.de \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).