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

Getting completion to tell the user what to do



This ought to be an easy one in the new 3.1.6 completion system, but I just
can't get it to work.

I'm trying to complete "subject string goes here" as in

	mail -s "subject string goes here"

What I want is to offer no completions at all, because the subject is free-
form text, but print a hint to the user as to what he's supposed to type.

The following almost works (inside a completion function the rest of which
is not interesting):

  compadd -S '' -X 'Please enter the subject of the message' ''

but because there's a unique completion, the explanation is printed only
when the user types ^D, and there's no beep to let him know why tab isn't
doing anything.  OK, I thought, I can force a listing:

  compadd -S '' -X 'Please enter the subject of the message' ''
  compstate[list]=list
  compstate[force_list]=yes
  compstate[restore]=no

but that doesn't work -- there's still no explanation printed.

What obvious thing have I forgotten/overlooked here?  Is there an entirely
better alternative to using compadd -X ?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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