Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: _complete_debug and Re: Completion troubles



On May 1, 5:45pm, Bart Schaefer wrote:
> 
> I get an error message about ~/.nedit not being found.  I don't have
> to have a .nedit to run nedit, do I?

No, I should have thought of that when I reworked _nedit with
_arguments before submitting it. Thanks for sorting that out.

> I have a suspicion that you're getting the wrong version of _nedit
> somehow, but I can't be sure.

Oops, that was the problem, sorry. I'll have to add a directory to the
end of my fpath for writing new functions.

> Use _complete_debug, ^X?, and examine the trace file.

I actually, have nedit aliased to /usr/local/bin/nc and _complete_debug
had a few problems creating a trace file with lots of slashes in its
name. Small fix follows. Once fixed, that was useful, thanks.

With the print -zR line in _complete_debug, why is $VISUAL and $EDITOR
used? Why would anyone want to edit the trace file? Surely it would be
better to just use ${PAGER:-more} by default and use a style for anyone
who wants greater control and for warped people who like to use vi as
their pager as well as their editor.
 
> } 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:

You get what I would expect. Try setting the glob style to a true value.
It is done on line 54 of _expand. I tried running dev-22 to see what has
changed. It seems that in dev-22 _expand was only passed the '+' whereas
now, it also gets '~' so it is expanding to whatever ~+ is. In a way,
this makes more sense.

> 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

You're right about substitute being true as being significant. I'm not
sure that your fix has worked enitiely though - I get an error message
about the closing brace being expected. What do you get if you do:
exp='${foo'
echo $(print -lR - ${(e)exp} 2>/dev/null)

Oliver

--- Completion/Commands/_complete_debug	Sun Apr 30 11:04:29 2000
+++ Completion/Commands/_complete_debug	Tue May  2 10:51:55 2000
@@ -4,7 +4,7 @@
 unsetopt markdirs globsubst shwordsplit nounset ksharrays
 
 (( $+_debug_count )) || integer -g _debug_count
-local tmp=${TMPPREFIX}${$}${words[1]}$[++_debug_count]
+local tmp=${TMPPREFIX}${$}${words[1]:t}$[++_debug_count]
 local w="${(qqq)words}"
 
 [[ -t 2 ]] && exec 3>&2 2>| $tmp



Messages sorted by: Reverse Date, Date, Thread, Author