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

zsh and RPM: a case of study (for me)



Hi,

I'm a new subscriber to this list. I've used zsh for only 4 days now,
but to my opinion it plain rocks. It already saves me a lot of time, no
doubt on this, and I've even hacked a bit the base distribution that
comes with it so that it can handle lftp (a change in a #compdef, no big
deal) and .tar.bz2 archives cleanly.

But all the rest is obscure to me.

I've d/led the postscript of the manual and printed out, guess what,
chapters 20, 21 and 23. But I haven't got what I want. Like all manuals,
unfortunately, it's exhaustive but doesn't give enough examples :(

What are really completion widgets? Even after rereading the
aforementioned chapters 3, 4 times I still couldn't figure it out. When
are they called, what do they do, etc, and more importantly, HOW TO
CREATE ONE!

Just for example, lets say I have a:

compctl -X bar -k "(a b)" foo

how can I do so that it's actually a completion widget which returns the
"(a b)" stuff? Or am I missing the point completely?

Another probably dumb example: I'm used to the bash key sequences
(C-x|Esc)(!|@|~|/|$), how can I reproduce them in a simple manner?

And for the hardest part now: a set of functions|widgets|whatever for
rpm...

I make RPMs quite often indeed, and I'd like:

rpm -b<whatever> [ --target=whatever ] <TAB>

to complete on *.spec files,

rpm -q<whatever but p or f> --<TAB> <TAB>

to complete on long options (--queryformat for example) then installed
rpms,

<the above but with -qp>

to complete on *.(src|any_architecture).rpm,

rpm -qf <TAB>

to complete on files, etc.etc. and this is only one major mode of RPM.
The others are certainly easier (also consider the different completions
possible on a --queryformat - ugh)

The problem is that I can generate each of these arrays individually (a
mano for the options), but not tie them together so that it completes
correctly in each of these cases... And I fear that the compctl function
may not be enough for this :(

Oh, also, there seems to be a bug with ZLS_COLORS: empty lines are
stuffed with some random colors and it doesn't like custom foreground
colors for files in the dircolors mechanism...

I don't want this message to look like a rant, it's not - I really love
this shell, but I wish there were a good, explanative, to-the-point
programming guide too...

Regards,
--
fg

# rm *;o
o: command not found



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