From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11091 invoked from network); 14 Jan 2008 09:54:15 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 14 Jan 2008 09:54:15 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 3054 invoked from network); 14 Jan 2008 09:54:09 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 14 Jan 2008 09:54:09 -0000 Received: (qmail 13492 invoked by alias); 14 Jan 2008 09:54:05 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24388 Received: (qmail 13478 invoked from network); 14 Jan 2008 09:54:04 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 14 Jan 2008 09:54:04 -0000 Received: from virusfilter.dotsrc.org (bifrost [127.0.0.1]) by spamfilter.dotsrc.org (Postfix) with ESMTP id 7F3C28056E1A for ; Mon, 14 Jan 2008 10:54:02 +0100 (CET) Received: from cluster-g.mailcontrol.com (cluster-g.mailcontrol.com [85.115.41.190]) by bifrost.dotsrc.org (Postfix) with ESMTP for ; Mon, 14 Jan 2008 10:54:02 +0100 (CET) Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly18g.srv.mailcontrol.com (MailControl) with ESMTP id m0E9ro7f022479 for ; Mon, 14 Jan 2008 09:53:55 GMT Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Mon, 14 Jan 2008 09:49:38 +0000 Date: Mon, 14 Jan 2008 09:49:38 +0000 From: Peter Stephenson To: zsh-workers Subject: Re: "show" completion et al spammy when binaries don't exist Message-ID: <20080114094938.793eec5f@news01> In-Reply-To: <237967ef0801121257s6a478358k897be96f607b7408@mail.gmail.com> References: <237967ef0801121257s6a478358k897be96f607b7408@mail.gmail.com> Organization: CSR X-Mailer: Claws Mail 3.2.0 (GTK+ 2.10.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 14 Jan 2008 09:49:38.0512 (UTC) FILETIME=[C7120500:01C85692] X-Scanned-By: MailControl A-06-00-00 (www.mailcontrol.com) on 10.71.0.128 X-Virus-Scanned: ClamAV using ClamSMTP On Sat, 12 Jan 2008 21:57:35 +0100 "Mikael Magnusson" wrote: > I was looking at another window while writing and typed > show show gi > instead of git show gi and got the following: > % show show gi_mh:1: command not found: mhpath > _mh:1: command not found: mhparam > _mh:1: command not found: mhpath > _mh:1: command not found: mhparam > _mh:1: command not found: mhpath > _mh:1: command not found: mhparam > _mh:1: command not found: mhpath > _mh:1: command not found: mhparam > show show gi > ---- no match for: `sequence' or `corrections' > > After the error messages the prompt wasn't redrawn correctly, but I > think that is expected. In _mh all commands are called with 2> > /dev/null, but that doesn't help much since zsh is the one to print > the messages. Which leads me to ask, is the stderr output of > completion scripts ever wanted in the terminal? Maybe it should be > redirected more centrally? Putting > which mhpath >& /dev/null || return > on the first line of _mh fixes the problem, I don't know if some other > method would be preferred. Probably something like this. Index: Completion/Unix/Command/_mh =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_mh,v retrieving revision 1.7 diff -u -r1.7 _mh --- Completion/Unix/Command/_mh 9 Dec 2005 19:21:54 -0000 1.7 +++ Completion/Unix/Command/_mh 14 Jan 2008 09:48:34 -0000 @@ -1,5 +1,10 @@ #compdef ali anno burst comp dist flist flists folder folders forw inc mark mhlist mhmail mhn mhparam mhpath mhshow mhstore msgchk next packf pick prev refile repl rmf rmm scan show sortm whom +if [[ -z $commands[mhpath] ]]; then + _message "MH commands are not available" + return 1 +fi + # Completion for all possible MH commands. local mymhdir=${$(_call_program mhpath mhpath + 2>/dev/null):-~/Mail} local mhlib=/usr/lib/mh -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070