From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12162 invoked from network); 20 Jul 1999 08:54:41 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 20 Jul 1999 08:54:41 -0000 Received: (qmail 25205 invoked by alias); 20 Jul 1999 08:54:26 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2455 Received: (qmail 25198 invoked from network); 20 Jul 1999 08:54:24 -0000 From: "Bart Schaefer" Message-Id: <990720085351.ZM3390@candle.brasslantern.com> Date: Tue, 20 Jul 1999 08:53:51 +0000 In-Reply-To: <199907200708.JAA00727@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: Getting completion to tell the user what to do" (Jul 20, 9:08am) References: <199907200708.JAA00727@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: Sven Wischnowsky , zsh-users@sunsite.auc.dk Subject: Re: Getting completion to tell the user what to do MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jul 20, 9:08am, Sven Wischnowsky wrote: } Subject: Re: Getting completion to tell the user what to do } } Bart Schaefer wrote: } } > What I want is to offer no completions at all [...] } > but print a hint to the user as to what he's supposed to type. } > } > What obvious thing have I forgotten/overlooked here? Is there an entirely } > better alternative to using compadd -X ? } } Time for dirty tricks: } } compadd -UX 'Please...' -n '' } compstate[insert]='' Oho -- undocumented dirty tricks, no less. The compstate[insert] doc doesn't give any hint that it can be set but empty. Of which case that is documented is this a degenerate? } compstate[list]=list } compstate[force_list]=yes } } You need the -U because otherwise the empty string never matches } what's on the line (not even the empty string on the line). Really? When I first tried compadd -X 'Please ...' '' (without the -S) then every time I pressed TAB a single space got inserted (the suffix). If the empty string isn't a match, why did that happen? } Then we can switch off insertion completely. So that's what compstate[insert]='' means? } If you want the string to be listed only on a TAB with an empty string } you can do `compadd -X "Please..." -n dummy' -- i.e. add a string with } matching. Presumably then "dummy" should be something that can't possibly match? Or does that not matter? } The -n, of course, is just to be sure that the matches are not visible. } } Is that good enough? It's just marvelous, thanks. One question, though -- I thought that we made kill-whole-line erase the completion listing, but it doesn't seem to do that in this case: zagzig% mail -s leaves me with zagzig% Please enter a descriptive subject which is rather annoying when I start in typing some completely different command and doing completions for it that don't themselves produce a list. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com