zsh-users
 help / color / mirror / code / Atom feed
* compsys issues
@ 2004-10-27 13:26 DervishD
  2004-10-27 14:08 ` Oliver Kiddle
  0 siblings, 1 reply; 6+ messages in thread
From: DervishD @ 2004-10-27 13:26 UTC (permalink / raw)
  To: Zsh Users

    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/


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-10-27 16:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-27 13:26 compsys issues DervishD
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

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).