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

Re: completion



On Dec 11,  8:40am, Ray Andrews wrote:
} Subject: Re: completion
}
} > } On 12/10/2014 04:34 PM, Oliver Kiddle wrote:
} > } > The five colons are included because they prevent the completer style
} >
} If there's an explanation of the five colons I've missed it.

Section 20.3.1 Completion System Configuration - Overview

Third paragraph:

The context string always consists of a fixed set of fields, separated
by colons and with a leading colon before the first, in the form
:completion:FUNCTION:COMPLETER:COMMAND:ARGUMENT:tag.
___________1________2_________3_______4________5

A bit later:

The context is gradually put together as the functions are executed,
starting with the main entry point, which adds :completion: and the
FUNCTION element if necessary.  The completer then adds the COMPLETER
element.  The contextual completion adds the COMMAND and ARGUMENT
options.  Finally, the TAG is added when the types of completion are
known.

} And I'm not being theatrical.  If five colons has meaning, then one might
} expect some other number of colons to have meaning as well. I tried to
} understand that as empty fields as well, but the number of colons in
} various examples changes so it can't be a dumb array kind of thing.

They are in fact empty fields, but (again quoting section 20.3.1):

When looking up styles the completion system uses full context names,
including the tag.  Looking up the value of a style therefore consists
of two things:  the context, which may be matched as a pattern, and the
name of the style itself, which must be given exactly.

Styles are a little inside-out in that the setting contains the pattern
and the later lookup contains the fixed string to match.

-- 
Barton E. Schaefer



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