zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: bug with ((val\:desc ...)) actions in _alternative
@ 2003-03-13  9:35 Oliver Kiddle
  0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2003-03-13  9:35 UTC (permalink / raw)
  To: Zsh workers

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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-03-13  9:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-13  9:35 PATCH: bug with ((val\:desc ...)) actions in _alternative Oliver Kiddle

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