From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19169 invoked by alias); 9 Nov 2014 18:51:45 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33660 Received: (qmail 289 invoked from network); 9 Nov 2014 18:51:32 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=GYGgRrTO c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=SIIzNhFQMAoYHFuFP8IA:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <141109105139.ZM27532@torch.brasslantern.com> Date: Sun, 09 Nov 2014 10:51:39 -0800 In-reply-to: <20141108204123.1fcc698e@pws-pc.ntlworld.com> Comments: In reply to Peter Stephenson "Re: 'whence' question" (Nov 8, 8:41pm) References: <545A6D66.3080500@eastlink.ca> <1458.1415209763@thecus.kiddle.eu> <20141105180035.22f6e9b1@pwslap01u.europe.root.pri> <141105204330.ZM2973@torch.brasslantern.com> <20141106211017.11b8848a@pws-pc.ntlworld.com> <20141108204123.1fcc698e@pws-pc.ntlworld.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: "Zsh Hackers' List" Subject: Re: 'whence' question MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Nov 8, 8:41pm, Peter Stephenson wrote: } } It's not worth factoring out the common code; it would need a whole } heap of options passing in, passing back a value ignored in one case, } passing in both a string and a pattern where only one is used each } time... Unless someone else can see a neater way. Anyway, I will } commit this and someone else can apply their elegant optimisations. Cf. 33656. } The results would look better with a bit more sorting, but that's a } separate issue. With 33653: torch% noglob whence -m zsh* /usr/local/bin/zsh /usr/local/bin/zsh-5.0.2-dev-0 /usr/local/bin/zsh-5.0.3 /usr/local/bin/zsh-5.0.4 /usr/local/bin/zsh-5.0.5 /usr/local/bin/zsh-5.0.7 /usr/local/bin/zsh.old /etc/zshenv /etc/zshrc torch% noglob whence -am zsh* /usr/local/bin/zsh-5.0.7 /usr/local/bin/zsh-5.0.3 /usr/local/bin/zsh /usr/local/bin/zsh-5.0.4 /usr/local/bin/zsh.old /usr/local/bin/zsh-5.0.5 /usr/local/bin/zsh-5.0.2-dev-0 /bin/zsh torch% We've lost /etc/zshenv and /etc/zshrc in the -a case. This isn't wrong, because they're filtered out by iscom(). However: torch% whence -mv zshenv zshenv is /etc/zshenv torch% whence -av zshenv zshenv not found torch% whence -amv zshenv torch% With 33656 the output of -amv is the same as -av in this latter case (both print "zshenv not found"). Yes, an "else" could be added to the "if (iscom(...))" in 33653 to get the "not found", but 33656 also produces the -m sort order for -am when there is more than one match. -- Barton E. Schaefer