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

Re: Explicit colons in zstyle

On Thu, 29 Mar 2012 20:59:25 +0200
Jesper Nygårds <jesper.nygards@xxxxxxxxx> wrote:
> Is there something special about how a style should be expressed when
> it relates to "completer"?. I started noticing in some examples from
> The Book, that completer is not treated exactly the same as other
> styles.
> Here's the well know most-recent-file example:
> zstyle ':completion:most-recent-file::::' completer _menu _files _match
> zstyle ':completion:most-recent-file:*' file-sort modification
> zstyle ':completion:most-recent-file:*' hidden all
> zstyle ':completion:most-recent-file:*' file-patterns '*(.):normal\ files'
> Is there a reason why the first line contains so many colons? To me it
> looks like it would be equivalent to the other lines, containing an
> asterisk.

I think the book (Oliver wrote that bit) is just making the point that
the completer style is always looked up with most of the fields empty.
By recognising the fact you can make it match many of the fields

The only difference with replace the :::: with :* is that it becomes
according to the rules a less exact match, so that if you happened to
have both definitions the former would take precedence.  That's not
something you typically need to worry about.

Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/

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