zsh-users
 help / color / mirror / code / Atom feed
* zsh and RPM: a case of study (for me)
@ 1999-09-29 19:27 Francis GALIEGUE
  1999-09-29 19:53 ` Chmouel Boudjnah
  1999-09-29 20:10 ` Adam Spiers
  0 siblings, 2 replies; 11+ messages in thread
From: Francis GALIEGUE @ 1999-09-29 19:27 UTC (permalink / raw)
  To: zsh-users

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


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: various completion queries
@ 1999-09-30 23:50 Benjamin Korvemaker
  1999-10-01  7:11 ` Adam Spiers
  0 siblings, 1 reply; 11+ messages in thread
From: Benjamin Korvemaker @ 1999-09-30 23:50 UTC (permalink / raw)
  To: zsh-users

Ooooh.. I'm *SO* glad I asked before hacking this time. I'm much
happier leaving the shell internals alone. The big questions now:
1) How can I have incremental-word-complete ON by default (ie. it's on
   when I start typing)
2) When there are too many completions, and a prompt like

zsh: do you wish to see all 102 possibilities? 

   shows up, can I simply get it to:
    a) not prompt,
    b) not list, and
    c) maybe say "**lotsa completions - not listing**"

Thanks for the help!

Ben



Peter Stephenson said:
[...]
> > Benjamin Korvemaker (benjamin@cs.ualberta.ca) wrote:
> > > I'm at that point in my life where I need a shell that fills in the
> > > completion automagically and changes it as necessary the more I type
> > > (just like that horrible feature that MS products tend to have).
> > 
> > If I understand you correctly, then yes, there's a function called
> > incremental-complete-word
> 
> Yes, that's the place to look first.  It could probably do with some
> developing --- it's getting quite complicated, almost like an editor within
> the editor.
> 
> > Presumably you'd want to tell it complete words from the history.  I
> > don't know when it first appeared, but you're best off using it with
> > the latest development versions: 3.1.6 and later.
> 
> You'll certainly need 3.1.6; although it's not actually a new completion
> widget, and should interact happily with old compctl-style completion (I
> haven't tried), it still needs editor features from 3.1.6 or later.
> 
> One remaining task might be to allow it to combine with specific completion
> widgets, not just ordinary contextual completion.  Actually, that shouldn't
> be so hard: replace the call to `zle complete-word' with something more
> general which tests if a parameter with an alternative command was set by a
> wrapper.  The trick is to make sure such commands don't use menu
> behaviour, which will confuse it.
-- 
Benjamin Korvemaker
benjamin@cs.ualberta.ca
	I was born in Nicaragua and I felt there wasn't enough
        political instability in my life. So I moved to Quebec.
			    - Marta Chaves


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

end of thread, other threads:[~1999-10-01  7:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-29 19:27 zsh and RPM: a case of study (for me) Francis GALIEGUE
1999-09-29 19:53 ` Chmouel Boudjnah
1999-09-29 20:11   ` Adam Spiers
1999-09-30 10:03   ` Francis GALIEGUE
1999-09-29 20:10 ` Adam Spiers
1999-09-30  9:05   ` various completion queries Peter Stephenson
1999-09-30 12:19   ` zsh and RPM: a case of study (for me) Francis GALIEGUE
1999-09-30 16:40     ` Chmouel Boudjnah
1999-09-30 19:10     ` Adam Spiers
1999-09-30 23:50 various completion queries Benjamin Korvemaker
1999-10-01  7:11 ` Adam Spiers

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