From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12273 invoked from network); 3 Mar 1999 16:05:38 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Mar 1999 16:05:38 -0000 Received: (qmail 4302 invoked by alias); 3 Mar 1999 16:05:18 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5627 Received: (qmail 4292 invoked from network); 3 Mar 1999 16:05:16 -0000 X-Authentication-Warning: awayteam.zanshin.com: schaefer set sender to schaefer@tiny.zanshin.com using -f From: Bart Schaefer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14045.23816.712960.113814@localhost.localdomain> Date: Wed, 3 Mar 1999 08:02:16 -0800 (PST) To: "Andrej Borsenkow" Cc: "ZSH workers mailing list" Subject: Re: Count of last matches (was: RE: Reading completion manual) In-Reply-To: <000a01be6554$f8102b20$21c9ca95@mowp.siemens.ru> References: <000a01be6554$f8102b20$21c9ca95@mowp.siemens.ru> X-Mailer: VM 6.65a under Emacs 20.3.5.1 Reply-To: Bart Schaefer Andrej Borsenkow writes: > > > Applied to all three: what about some return code to indicate, if > > some matches were added? Currently one has to save, and then > > compare, compstate[nmatches], that looks somewhat ugly. Using > > return code would provide for > > > > compgen -k friends || compgen -u > > What about following: add new item to compstate, say, last_nmatches, > that hold count of matches added by the *last* used compgen, compadd, > compcall. That might be useful, but I think the most useful bit of information is whether anything at all was added (or whether the calling function should behave as if anything at all was added, which may be a different thing). So even if a last_nmatches key were added to compstate, I'd still be in favor of a useful return value from compgen et al.