From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12180 invoked by alias); 9 Nov 2009 17:52:37 -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: 27375 Received: (qmail 15850 invoked from network); 9 Nov 2009 17:52:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received-SPF: none (proxy.melb.primenet.com.au: domain at klanderman.net does not designate permitted sender hosts) From: Greg Klanderman To: zsh-workers@zsh.org Subject: Re: bug in 'rm' completion Reply-To: gak@klanderman.net Date: Mon, 09 Nov 2009 12:52:26 -0500 In-Reply-To: <091109092926.ZM26572@torch.brasslantern.com> (Bart Schaefer's message of "Mon, 09 Nov 2009 09:29:26 -0800") Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.17 (linux) References: <19191.43212.832827.724369@gargle.gargle.HOWL> <091109092926.ZM26572@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii >>>>> On November 9, 2009 Bart Schaefer wrote: > You forgot the patch. Hi Bart, Duh.. see below. It's just not considering the last word from the line when generating the ignore pattern. What I think is needed is to generally remove the current word from incorporation into the ignore pattern, but I don't know how to do that. If I knew how to relate $CURRENT to an element of $line that would do it. greg Index: Completion/Unix/Command/_rm =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_rm,v retrieving revision 1.2 diff -u -r1.2 _rm --- Completion/Unix/Command/_rm 23 Nov 2008 18:23:29 -0000 1.2 +++ Completion/Unix/Command/_rm 9 Nov 2009 15:49:39 -0000 @@ -33,7 +33,7 @@ case $state in (file) declare -a ignored - ignored=(${line//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) + ignored=(${line[1,-2]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) _files -F ignored && ret=0 ;; esac