zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Adam Spiers <adam@spiers.net>,
	zsh workers mailing list <zsh-workers@sunsite.auc.dk>
Subject: Re: _complete_help troubles
Date: Wed, 12 Apr 2000 03:26:53 +0000	[thread overview]
Message-ID: <1000412032653.ZM11732@candle.brasslantern.com> (raw)
In-Reply-To: <20000411235752.A2739@thelonious.new.ox.ac.uk>

On Apr 11, 11:57pm, Adam Spiers wrote:
} Subject: _complete_help troubles
}
} > > $ ls <TAB>
} > > _complete_help:39: bad pattern: \n    all-files  (_files _default)

BTW, you do mean <C-x h> there, and not <TAB>, right?  If _complete_help
is running when you hit TAB, either you have rather surprising bindkeys,
or something very bad is happening.

} The relevant bit of trouble-making code is:
} 
}   for i in "${(@ok)help_funcs}"; do
}     text="${text}
} tags in context :completion:${i}:"
}     tmp=()
}     for j in "${(@s.:.)help_funcs[$i][2,-1]}"; do
}       tmp=( "$tmp[@]" "${(@s.,.)help_tags[${i}${j}][2,-1]}" )
}     done
}     zformat -a tmp '  (' "$tmp[@]"
}     tmp=( '
}     '${^tmp}')' )             <<<<<< this line gives the error
}     text="${text}${tmp}"
}   done
} 
} tmp has the value `all-files  (_files _default' when the error occurs,
} which doesn't look right.

No, that is in fact right.  The output should look something like

zagzig[99] ls <C-x h>
tags in context :completion::complete:ls::
    all-files  (_files _default)

and you'll note the ')' on the failing line.

However, look at this:

zagzig[99] setopt shwordsplit
zagzig[100] ls <C-x h>
tags in context :completion::complete:ls::
    all-files) 
    (_files) 
    _default)

I'm entirely certain that's NOT supposed to happen.  And then:

zagzig[109] setopt globsubst
zagzig[110] ls <C-x h>
_complete_help:39: bad pattern: \n    (_files)

So the problem is that _complete_help is expecting the standard options
from _main_complete, but of course it doesn't get them because it's not
called through the regular completion system.

Maybe we should put these (without localoptions, obviously) in another
function that can be called to install the standard completion options?

Except that rcexpandparam worries me just a tad ...

Index: Completion/Commands/_complete_help
===================================================================
@@ -1,6 +1,9 @@
 #compdef -k complete-word \C-xh
 
 _complete_help() {
+  setopt localoptions nullglob rcexpandparam extendedglob
+  unsetopt markdirs globsubst shwordsplit nounset ksharrays
+
   local _sort_tags=_help_sort_tags text i j k
   typeset -A help_funcs help_tags help_sfuncs help_styles
 

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  reply	other threads:[~2000-04-12  3:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-11 20:26 _perl_modules broken? Adam Spiers
2000-04-11 21:50 ` Bart Schaefer
2000-04-11 22:57   ` _complete_help troubles Adam Spiers
2000-04-12  3:26     ` Bart Schaefer [this message]
2000-04-12 11:21       ` Adam Spiers

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=1000412032653.ZM11732@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=adam@spiers.net \
    --cc=zsh-workers@sunsite.auc.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).