From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21519 invoked by alias); 18 Oct 2011 20:06:17 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16514 Received: (qmail 5448 invoked from network); 18 Oct 2011 20:06:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at benizi.com does not designate permitted sender hosts) Date: Tue, 18 Oct 2011 16:05:35 -0400 (EDT) From: "Benjamin R. Haskell" To: zsh-users@zsh.org Subject: Re: Use helper functions for git completion in my own completions In-Reply-To: <87mxcyv6u6.fsf@deep-thought.43-1.org> Message-ID: References: <87mxcyv6u6.fsf@deep-thought.43-1.org> User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 18 Oct 2011, Ansgar Burchardt wrote: > Hi, > > is it possible to use the helper functions defined in "_git" for the > git command in my own completion functions? Yes, though with the recent(-ish) rewrite (and in general), I'm not sure there's really a stable API. E.g. if __git_pattern_escape isn't needed by _git anymore, I suspect it would simply disappear. As would __git_commits2, or whatnot. > I am taking my first steps with writing completions for the > git-import-dsc, git-import-orig commands in Debian, but am not surehow > I can make sure helper functions such as __git_branch_names are > available when I user "git-import-dsc" (they are available when I use > "git import-dsc"). If you create the _git-{command-name} function (e.g. _git-import-dsc), it will be used by _git (at least by the version of _git I'm currently using). By virtue of being used from within _git, all of the helper functions will exist, because they're defined when _git is autoloaded. -- Best, Ben