zsh-workers
 help / color / mirror / code / Atom feed
From: "Ben Veal" <benveal92@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-workers@zsh.org
Subject: Re: exposing completions data to user
Date: Tue, 25 Oct 2016 05:16:36 +0100	[thread overview]
Message-ID: <87oa292hcr.fsf@it.com> (raw)
In-Reply-To: <161018075006.ZM25400@torch.brasslantern.com> (Bart Schaefer's message of "Tue, 18 Oct 2016 07:50:06 -0700")

Bart Schaefer <schaefer@brasslantern.com> writes:

> On Oct 18,  1:06am, Ben Veal wrote:
> }
> }    To do this I need access to the list of possible
> }    completions and their descriptions.
> }    As far as I can determine, this information is not
> }    normally available
>
> This is what the -O -A and -D options of the compadd builtin are meant
> to accomplish.  Are you capturing completions for a specific context
> for which you are writing the completion function, or are you trying
> generically to capture the strings that any completion would normally
> display via ZLE?
>
> If the former you should be able to structure your own compadd calls
> appropriately.  If the latter you might be able to get away with a
> wrapper around "builtin compadd ..." that changes the arguments; see
> for example what _approximate does.
>
> }    and so I need to write a module
> }    which exposes this data.
>
> If you determine that you do need to go this way, looking at the
> imlementation of the above compadd options is probably your best bet.

Yes, I want to get the completions and their
descriptions generically so that I can use zaw as an
alternative method for performing completions.

After poking around the source code some more it seems
that amatches[i]->matches[j]->str should contain the
completions (for different values of i and j). However
when I try exploring that datastructure at breakpoints
in the printlist, ilistmatches, and complistmatches
functions gdb tells me: "Cannot access memory at address 0x0" 
I get the same message when I try pmatches.

Any more advice?
-- 
 


  reply	other threads:[~2016-10-25  5:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18  0:06 Ben Veal
2016-10-18 14:50 ` Bart Schaefer
2016-10-25  4:16   ` Ben Veal [this message]
2016-11-13  8:00     ` Bart Schaefer

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=87oa292hcr.fsf@it.com \
    --to=benveal92@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@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).