From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 466 invoked from network); 1 May 2000 17:45:52 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 May 2000 17:45:52 -0000 Received: (qmail 2689 invoked by alias); 1 May 2000 17:45:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11043 Received: (qmail 2662 invoked from network); 1 May 2000 17:45:37 -0000 From: "Bart Schaefer" Message-Id: <1000501174527.ZM12695@candle.brasslantern.com> Date: Mon, 1 May 2000 17:45:27 +0000 In-Reply-To: <390DAF22.A11AFB7B@u.genie.co.uk> Comments: In reply to Oliver Kiddle "Completion troubles" (May 1, 5:21pm) References: <390DAF22.A11AFB7B@u.genie.co.uk> X-Mailer: Z-Mail (5.0.0 30July97) To: Zsh workers Subject: Re: Completion troubles MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 1, 5:21pm, Oliver Kiddle wrote: } Subject: Completion troubles } } I've had a couple of problems with the latest zsh: } } nedit -lm } Gives me a message about _all_labels:39: command not found: -M I get an error message about ~/.nedit not being found. I don't have to have a .nedit to run nedit, do I? } I can't see where this might be a problem anywhere in _nedit. I can } reproduce it from a basic zsh -f based setup (although it complains } about -J instead). Use _complete_debug, ^X?, and examine the trace file. You should see a line similar to this (I have PS4='+%1N:%i%1(_.:%_.): ') somewhere: +_wanted:23:while: _all_labels -J neditlanguages expl language mode compadd - (with the list of languages following the "_"). _all_labels expects the command to run to be $4 ("compadd" above, "language mode" is $3). I have a suspicion that you're getting the wrong version of _nedit somehow, but I can't be sure. } The other thing is the _expand completer now seems to be expanding } everything after a tilde which is annoying. Hmm, that doesn't happen to me; I get this sort of thing: zagzig[76] ls ~- Completing directory stack 0 -- /usr/src/local/zsh/zsh-forge/current 1 -- /usr/src/local/zsh/zsh-3.1.6 If there is no directory stack, then it immediately inserts `0/' and goes on completing. } I think _expand really needs a rethink because it is more } trouble than it is worth at the moment. For example, if you do: } cd ${foo } you get a message about a closing brace being expected That one also works for me. I think you must have the `substitute' style set to a true value. However, we can fix the problem with the closing brace; that happens because a missing close-brace is a parse error that aborts the entire function. The workaround is to force that parse error into a subshell; unpleasant, but nothing else will do. (Ick, those kind of aborts do very unpleasant things to _complete_debug, leaving stderr pointing into the completion trace file. I can't think of a fix, though.) Index: Completion/Core/_expand =================================================================== @@ -32,13 +32,14 @@ exp=("$word") # First try substitution. That weird thing spanning multiple lines -# changes quoted spaces, tabs, and newlines into spaces. +# changes quoted spaces, tabs, and newlines into spaces and protects +# this function from aborting on parse errors in the expansion. { zstyle -s ":completion:${curcontext}:" substitute expr || { [[ "$curcontext" = expand-word:* ]] && expr=1 } } && [[ "${(e):-\$[$expr]}" -eq 1 ]] && - exp=( "${(e)exp//\\[ -]/ }" ) + exp=( ${(f)"$(print -lR - ${(e)exp//\\[ +]/ } 2>/dev/null)"} ) # If the array is empty, store the original string again. Index: Completion/User/_nedit =================================================================== @@ -44,7 +44,7 @@ "$nedit_common[@]" fi -[[ $state = lang ]] && +[[ $state = lang && -f ~/.nedit ]] && _wanted neditlanguages expl 'language mode' \ compadd - ${(f)"$(sed -n \ '/^nedit.languageMode/,/^nedit/ s/.* \([^:]*\).*/\1/p' < ~/.nedit)"} -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com