From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23038 invoked by alias); 15 Dec 2014 09:08:58 -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: 19540 Received: (qmail 16060 invoked from network); 15 Dec 2014 09:08:56 -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.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=PYxIXZlY c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=A92cGCtB03wA:10 a=_d8vA19692ixcpYuy7gA:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <141215010917.ZM24252@torch.brasslantern.com> Date: Mon, 15 Dec 2014 01:09:17 -0800 In-reply-to: Comments: In reply to Rocky Bernstein "Re: How to get compadd to not sort words?" (Dec 15, 1:59am) References: <141214185002.ZM24092@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Subject: Re: How to get compadd to not sort words? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Dec 15, 1:59am, Rocky Bernstein wrote: } } Many thanks. } } This does the trick. I'm happy with getting this in the order given without } special formatting of negative numbers. You're welcome. The special formatting was just an example I picked to show how you'd associate styles with the completion results. In fact, just to flesh out the example a little ... If you want ^Xh (_complete_help) to be able to generate useful help for the context, you need to call _tags to initialize that part of the system, and then you should use the _requested wrapper to make the call to _description and compadd. So you might do _unsorted() { local expl ret=1 _tags numbers letters while _tags; do if _requested -V numbers expl 'Some Numbers' compadd 1 2 -1 -2 3 0 then ret=0 fi if _requested -V letters expl 'Some Letters' compadd A B Z X C M then ret=0 fi done return ret } This is obviously a lot more interesting if the completions are more than a single character/digit. For sorted groups, use -J instead of -V. (No, there isn't a mnemonic for why -J and -V got used here; it was because they were single letters not already being used for something else.)