zsh-users
 help / color / mirror / code / Atom feed
From: DervishD <zsh@dervishd.net>
To: Zsh Users <zsh-users@sunsite.dk>
Subject: compsys issues
Date: Wed, 27 Oct 2004 15:26:10 +0200	[thread overview]
Message-ID: <20041027132610.GA9928@DervishD> (raw)

    Hi all :)

    As I told a couple of messages ago, I'm playing with the new
completion system but without using the set of functions shipped with
zsh, since I want to learn as goog as I can how it works.

    Obviously, this leads to problems...

    Anyway, I want to ask you a question about compsys. Let's say I
set up this simple widget for learning:

    # expand-or-complete is currently bound to <TAB>
    zle -C expand-or-complete expand-or-complete _completer

    function _completer () {

        compstate[insert]=${compstate[insert]//tab /}

        compadd -f - $PREFIX*(/)

        return 0
    }

    When I write 'cd ' at the prompt and hit tab, I'm presented with
the list of subdirs in the current dir (e.g):

    $ cd <TAB>
    Projects/ Music/ Work/ temporary/

    Let's say I pick 'Projects' and hit tab again. Now I'm presented
with this:

    $ cd Projects/<TAB>

    Projects/mta/ Projects/zsh-things/ Projects/more/

    But what I want is to be presented with:

    $ cd Projects/<TAB>

    mta/ zsh-things/ more/

    that's what I'm presented with the default .expand-or-complete
widget, and that's the behaviour I want.

    I've tried tweaking IPREFIX and PREFIX (with and without the help
from compset), I've tried generating the list of matches before
calling compadd, cleaning the undesired part before, etc. and nothing
works. I've read the info pages for compadd, compset, the special
parameters for completion and I've even taken a look at the provided
functions and I've not learnt anything :((( I've even eat a segfault
or two when using compadd with the '-p' option.

    Could anybody lend me a hand and explain me how all this works so
I can keep on practicing? Thanks a lot in advance :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.dervishd.net & http://www.pleyades.net/


             reply	other threads:[~2004-10-27 13:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-27 13:26 DervishD [this message]
2004-10-27 14:08 ` Oliver Kiddle
2004-10-27 14:54   ` DervishD
2004-10-27 15:43     ` Oliver Kiddle
2004-10-27 16:07       ` DervishD
2004-10-27 16:44   ` DervishD

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=20041027132610.GA9928@DervishD \
    --to=zsh@dervishd.net \
    --cc=zsh-users@sunsite.dk \
    /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).