From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10561 invoked by alias); 15 Dec 2014 16:16:23 -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: 19543 Received: (qmail 4455 invoked from network); 15 Dec 2014 16:16:20 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=+2Llf0Bh2kBpnqJNlJg5WpM3gnTUuKfFy7R9vP4QNp0=; b=pfvPi0RFcdnWmweYY0fY2aEjZp6c8Su2MZsFrI2Vhlsy0uvlhypU40vhlu8EmU47CZ Tq0+VxrZSlWWJzLDGlRWG8PPbHjmCC+Eb8nUNN5oRLAHAqLuhd5qjw9flZ/JqLmcqCuk IfRWum5fSwk+RCwKp271EipZkWjFR+2JScBVlvI+mgaJoo3cbMh1GpHvlmfskJBHblOp U7upzd9+rDb94/JKgWDK55cccXaj7SGepTbMQvnVkLKzU7e3nkaXZeJMaDrDD7iOmian m9RjiNfzp0ErKUkPCEktXdPmLaPKNNHUMtNmF4DFIfZI2bmWYaKhQe47NkKUMwGmA4Yo zRpw== MIME-Version: 1.0 X-Received: by 10.180.98.162 with SMTP id ej2mr10660783wib.39.1418660176968; Mon, 15 Dec 2014 08:16:16 -0800 (PST) In-Reply-To: <141215010917.ZM24252@torch.brasslantern.com> References: <141214185002.ZM24092@torch.brasslantern.com> <141215010917.ZM24252@torch.brasslantern.com> Date: Mon, 15 Dec 2014 11:16:16 -0500 Message-ID: Subject: Re: How to get compadd to not sort words? From: Rocky Bernstein To: Bart Schaefer Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=f46d04428274e7c426050a438f6d --f46d04428274e7c426050a438f6d Content-Type: text/plain; charset=UTF-8 Without a doubt the feature of help on a completion group is cool. Those numbers do fall into the category of a relative frame index. And there's an absolute frame index, a breakpoint number, and so on. And some of the categories are already built in like files. But as with all things zsh-specific, I find it hard to get to to work on my own. I've been working on zshdb recently not for any specific need, but because I have a little time right now to spend and over the years people have +1'd it during the times when I didn't have time to devote to it. (So a general hint to users - if you +1 a project it will tend encourage maintainers of the project to work on it.) The debugger completion code I have is at https://github.com/rocky/zshdb/blob/master/lib/complete.sh in case folks want to improve it. You can run it standalone. On Mon, Dec 15, 2014 at 4:09 AM, Bart Schaefer wrote: > 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.) > --f46d04428274e7c426050a438f6d--