Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Coloring completions



    Hi all :)

    I'm playing with compsys, and I don't understand what happens
with coloring. I currently don't use the shell functions for
completion, I use compsys but 'naked' (resuming: I don't have any
compinit call in my RC's), and when I hit 'TAB' (which currently is
bound to 'expand-or-complete'), the completions appear colored
, and that's ok because I have zsh/complist loaded. The problem
appears when I do the following:

bindkey "^O" completer
zle -C completer expand-or-complete completer

function completer () {
    if [[ $words[1] == cd ]]
    then
        compadd -f *(/)
    else
        compadd -f *
    fi
}

    That's a stupid test to play with compsys. If I do the above,
when I hit '^O', depending on the first word only dirs or all files
are listed, but they are listed without coloring. I thought coloring
was automatic as long as zsh/complist was loaded. If I do the above
(remember: I don't use the compsys shell functions), do I need to
'color' de completion matches myself?

    If it is not long, boring or off-topic: could anyone explain me
how the shell functions given with compsys do the coloring or what
should I read first to understand how _main_complete et al. do the
coloring? Given that _main_complete is far complex that my crappy
function above ;) the principles should be the same and the
completion matches are generated by compadd calls, so the coloring is
done by some function or by compsys itself, am I wrong?

    Thanks a lot in advance :)

    Raúl Núñez de Arenas Coronado

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



Messages sorted by: Reverse Date, Date, Thread, Author