zsh-users
 help / color / mirror / code / Atom feed
From: Pax Unix <paxunix@gmail.com>
To: zsh-users@zsh.org
Subject: How to change description for _user_expand completions?
Date: Sun, 26 Aug 2012 11:28:31 -0700	[thread overview]
Message-ID: <CADv1Z=qTRYPAzhORZb2Za6xvNUSa_4bAmvBMsjLDD6j23p-Tuw@mail.gmail.com> (raw)

Many times the completion function I write works, but I've always got
the uneasy feeling that it works because of a certain amount of
coincidence instead of intent.

I feel like I only know just enough completion-system magic to be
dangerous, so I'd appreciate any guidance.  It would be handy if there
were a zsh completion/expansion system cookbook.  zshcompsys(1) and
zshcompwid(1) explain what's available, but I've found it difficult to
figure out the "correct" way to accomplish something and support all of
the other features (like configurable styles, etc.) for my functions.

My current problem:  I've got a function called by _user_expand so I can
generate context-independent completions based on a particular prefix.

It works perfectly well, but the only description that ever appears is
either "all expansions" or "expansions" (or "original").  I want to
specify the description string from within my expander function,
tailored to the results I'm returning, rather than have to accept the
default.

I thought I could call _describe, but I can't seem to find the correct
parameters to make it work.

Is this possible?  Or since there could be any number of expansion
functions called, do the results have to all be lumped into the same
group because there's no tag information specific to each expander?

-- 
Shawn


             reply	other threads:[~2012-08-26 18:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-26 18:28 Pax Unix [this message]
2012-08-28 12:57 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADv1Z=qTRYPAzhORZb2Za6xvNUSa_4bAmvBMsjLDD6j23p-Tuw@mail.gmail.com' \
    --to=paxunix@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).