Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: bug in 'rm' completion
- X-seq: zsh-workers 27375
- From: Greg Klanderman <gak@xxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: bug in 'rm' completion
- Date: Mon, 09 Nov 2009 12:52:26 -0500
- In-reply-to: <091109092926.ZM26572@xxxxxxxxxxxxxxxxxxxxxx> (Bart Schaefer's message of "Mon, 09 Nov 2009 09:29:26 -0800")
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <19191.43212.832827.724369@xxxxxxxxxxxxxxxxxx> <m38wef4qqs.fsf@xxxxxxxxxxxxxx> <091109092926.ZM26572@xxxxxxxxxxxxxxxxxxxxxx>
- Reply-to: gak@xxxxxxxxxxxxxx
>>>>> On November 9, 2009 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author