From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24931 invoked by alias); 27 Feb 2013 00:42:00 -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: 17654 Received: (qmail 4739 invoked from network); 27 Feb 2013 00:41:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.128.51 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=+At7Fq/cL6dP9yt3D0xf0nZKzXSOEhxoRNUScxxnWgU=; b=EXd+hWtgg6zUxE/ZudeNfVrs7Xf4NTH09gLQma/D3wYS7eSICgBXNOpv79DYmo+yHh DziGgj3MTXYohneEuKOktR5FHBK9TC2LfAprSLexRxOq3FpWjJHpwi5o9q3tigHjY8Fq CM404fHnfI/8TcTuxOCVnFtGuzd6Z2rAE8OLm2vQ072xBrCKLx4HV8nSUP6D0jazAlj4 GY1r3bSOnWmbTbsfcLxAzPOltuJuODWLUCXX6ZQZTbJzxkpvKj4paYV5T+AzWGSHjIig G1VxLSkedL58bUXwZI2HSP10LKMregD9KJGB7Soi9q4FrMPHxO+D5GbNio/AQ4q148DY ZPqw== MIME-Version: 1.0 X-Received: by 10.224.174.80 with SMTP id s16mr5060693qaz.85.1361925709705; Tue, 26 Feb 2013 16:41:49 -0800 (PST) In-Reply-To: <130226080545.ZM4526@torch.brasslantern.com> References: <130226080545.ZM4526@torch.brasslantern.com> Date: Tue, 26 Feb 2013 19:41:49 -0500 Message-ID: Subject: Re: Zsh completion configuration From: joe M To: Bart Schaefer Cc: zsh-users@zsh.org Content-Type: text/plain; charset=ISO-8859-1 Hello Bart, Thanks for responding. It works like a charm. tags in context :completion::complete:-command-:: history-words (_history _history_or_autocd (eval)) commands builtins functions aliases suffix-aliases reserved-words jobs parameters (_alternative _command_names _autocd _history_or_autocd (eval)) commands (_path_commands _alternative _command_names _autocd _history_or_autocd (eval)) path-dirs (_path_commands _alternative _command_names _autocd _history_or_autocd (eval)) jobs (_jobs _alternative _command_names _autocd _history_or_autocd (eval)) parameters (_parameters _alternative _command_names _autocd _history_or_autocd (eval)) local-directories named-directories (_alternative _cd _autocd _history_or_autocd (eval)) users named-directories directory-stack (_tilde _alternative _cd _autocd _history_or_autocd (eval)) users (_users _tilde _alternative _cd _autocd _history_or_autocd (eval)) tags in context :completion::history::: history-words (_history) > Unless I'm misunderstanding your intent, you don't actually want to > change the tags from _command_names -- you just want to add another tag > that appears in completion output along with the _command_names tags? yes, that is exactly what I wanted to do. > And then install it for the context: > > compdef _history_or_autocd -command- I do not understand the "install" process. Is it good enough to have the function file (_history_or_autocd) anywhere in the $fpath? Or, does it have to be after the directory with _autocd? I added this "zstyle ':completion::complete:-command-:*' _history_or_autocd" to my zshrc, in addition to deleting my zcompdump and then running the above "compdef _history_or_autocd -command-" command. Just a rehash did not do the job. Any thoughts, please? > To explain a bit further, the completers in the completer style are in > general attempted until one returns a zero (true, success) status, at > which point the set of possible matches is assumed to be finished. To > merge the results of several completers you have to save the staus, try > the next one, and then return success if any of those completers was > successful. > > If you instead wanted to complete history and only try the defaults if no > history words matched, you could have shortcut this as > > compdef '_history || _autocd' -command- > > Of course whichever of these you choose has to happen after compinit is > run, otherwise _autocd will step on it when loaded. Thanks a lot for the explanation. The code makes so much more sense now. Thanks again, Joe