zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@sunsite.dk>
Subject: PATCH: bug with ((val\:desc ...)) actions in _alternative
Date: Thu, 13 Mar 2003 10:35:22 +0100	[thread overview]
Message-ID: <3708.1047548122@finches.logica.co.uk> (raw)

This:
  _alternative 'foos:foo:((one\:a two\:b))' 'bars:bar:((a\:one b\:two))'
doesn't work.

With more than one ((...)) action in an _alternative spec, after the
first `local ws' prints the value of ws.

The second problem with it was that it was not setting the tag as
specified in the spec. So the two things were not completed separately.

Oliver

Index: Completion/Base/Utility/_alternative
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_alternative,v
retrieving revision 1.2
diff -u -r1.2 _alternative
--- Completion/Base/Utility/_alternative	22 Jan 2002 10:22:48 -0000	1.2
+++ Completion/Base/Utility/_alternative	13 Mar 2003 09:28:06 -0000
@@ -1,7 +1,7 @@
 #autoload
 
 local tags def expl descr action mesgs nm="$compstate[nmatches]" subopts
-local opt curcontext="$curcontext"
+local opt ws curcontext="$curcontext"
 
 subopts=()
 while getopts 'O:C:' opt; do
@@ -33,13 +33,12 @@
 
         mesgs=( "$mesgs[@]" "${def%%:*}:$descr")
       elif [[ "$action" = \(\(*\)\) ]]; then
-        local ws
 
         # ((...)) contains literal strings with descriptions.
 
         eval ws\=\( "${action[3,-3]}" \)
 
-        _describe "$descr" ws -M 'r:|[_-]=* r:|=*' "$subopts[@]"
+        _describe -t "${def%%:*}" "$descr" ws -M 'r:|[_-]=* r:|=*' "$subopts[@]"
       elif [[ "$action" = \(*\) ]]; then
 
         # Anything inside `(...)' is added directly.


                 reply	other threads:[~2003-03-13  9:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3708.1047548122@finches.logica.co.uk \
    --to=okiddle@yahoo.co.uk \
    --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).