Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _complete_help vs. the matcher-list style
- X-seq: zsh-workers 11053
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: _complete_help vs. the matcher-list style
- Date: Tue, 2 May 2000 11:09:08 +0200 (MET DST)
- In-reply-to: "Bart Schaefer"'s message of Sun, 30 Apr 2000 09:50:14 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Bart Schaefer wrote:
> If you have a matcher-list style, using _complete_help causes any completion
> function that uses that style to be called once for each match-spec in the
> style. (I noticed this while working on a variant of _complete_debug.)
>
> I believe this is because _complete_help redefines compadd to always fail.
Which we need to be sure that all completers are used, of course.
> Nevertheless it's a bit of a pain, as no additional context information is
> obtained by trying the other matchers.
Hm, the easy way is to make the zstyle() function defined by
_complete_help return the empty string when used for the matcher-list
style.
But that also reminds me that I've been dreaming about support to
save/set/restore styles, for use by wrapper functions such as
_complete_help. If anyone has any ideas or suggestions for something
like that, I'd like to hear them.
Bye
Sven
Index: Completion/Commands/_complete_help
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_complete_help,v
retrieving revision 1.4
diff -u -r1.4 _complete_help
--- Completion/Commands/_complete_help 2000/04/12 03:32:51 1.4
+++ Completion/Commands/_complete_help 2000/05/02 09:07:18
@@ -27,7 +27,14 @@
esac
help_styles[${2}${_f}]="${help_styles[${2}${_f}]},${_t} ${3}:${_f}"
fi
- builtin zstyle "$@"
+
+ # No need to call the completers more than once with different match specs.
+
+ if [[ "$3" = matcher-list ]]; then
+ eval "${4}=( '' )"
+ else
+ builtin zstyle "$@"
+ fi
}
_main_complete
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author