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

PATCH and Re: Styles usage problem



Peter Stephenson wrote:

> "Andrej Borsenkow" wrote:
> > bor@itsrm2% zstyle -L
> > zstyle ':completion:*' completer _complete
> > zstyle ':completion*' completer _oldlist _complete _correct _approximate _mat
> > ch
> > 
> > In other words, I told zsh to use specific completers in every case - but Zsh
> > installed it's own, "more specific" style - and simply ingnored my settings.
> 
> I fell foul of this, too.  Maybe this is a case for use of the default tag
> --- after all, there's nothing to stop you defining completers with the
> pattern '*', and that should still take precedence over the supplied
> default.  Same probably applies to just about any zstyle supplied as a
> default.

Ahem, yes, even I stumbled over this. I now use `zstyle -d' before
setting my styles...

I don't see how the default tag would (really) help here. Is it enough 
if we explicitly mention in the compsys manual that compinit sets up
some default styles and that users might want to use `zstyle -d' plus
the output of `zstyle -L' as their starting point when modifying
styles?


The patch just makes sure that max-errors is set for approximation,
too, not only for correction.

Bye
 Sven

diff -u -r oldcompletion/Core/compinit Completion/Core/compinit
--- oldcompletion/Core/compinit	Fri Dec 17 21:39:20 1999
+++ Completion/Core/compinit	Mon Jan  3 19:45:30 2000
@@ -472,13 +472,13 @@
 
 # Default styles. This should be executed conditionally somehow.
 
-zstyle ':completion:*'        verbose       'yes'
-zstyle ':completion:*'        prefix-needed 'yes'
-zstyle ':completion:*'        prefix-hidden 'no'
-zstyle ':completion:correct'  max-errors    '2' numeric
-zstyle ':completion:correct'  prompt        'correct to:'
-zstyle ':completion:*'        completer     '_complete'
-zstyle ':completion*:default' list-colors   "${(s.:.)ZLS_COLORS:-${ZLS_COLOURS:-no=0:fi=0:di=0:ln=0:pi=0:so=0:bd=0:cd=0:ex=0}}"
+zstyle ':completion:*'                      verbose       'yes'
+zstyle ':completion:*'                      prefix-needed 'yes'
+zstyle ':completion:*'                      prefix-hidden 'no'
+zstyle ':completion:(correct|approximate):' max-errors    '2' numeric
+zstyle ':completion:correct:'               prompt        'correct to:'
+zstyle ':completion:*'                      completer     '_complete'
+zstyle ':completion*:default'               list-colors   "${(s.:.)ZLS_COLORS:-${ZLS_COLOURS:-no=0:fi=0:di=0:ln=0:pi=0:so=0:bd=0:cd=0:ex=0}}"
 (( $+SELECTMIN )) && zstyle ':completion*:default' menu "select=$SELECTMIN"
 zstyle ':completion:*' tag-order 'arguments values' options \
                                  globbed-files directories all-files

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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