zsh-workers
 help / color / mirror / code / Atom feed
From: Greg Klanderman <gak@klanderman.net>
To: zsh-workers@zsh.org
Subject: Re: bug in 'rm' completion
Date: Mon, 09 Nov 2009 12:52:26 -0500	[thread overview]
Message-ID: <m3639j4mcl.fsf@klanderman.net> (raw)
In-Reply-To: <091109092926.ZM26572@torch.brasslantern.com> (Bart Schaefer's message of "Mon, 09 Nov 2009 09:29:26 -0800")

>>>>> On November 9, 2009 Bart Schaefer <schaefer@brasslantern.com> 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


  reply	other threads:[~2009-11-09 17:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-09  5:29 Greg Klanderman
2009-11-09 16:17 ` Greg Klanderman
2009-11-09 17:29   ` Bart Schaefer
2009-11-09 17:52     ` Greg Klanderman [this message]
2009-11-09 21:20       ` Greg Klanderman
2009-11-10 15:52         ` Bart Schaefer
2009-11-12  2:48           ` Greg Klanderman
2009-11-12  4:21             ` Bart Schaefer
2009-11-12 17:22               ` Greg Klanderman
2009-11-09 16:29 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3639j4mcl.fsf@klanderman.net \
    --to=gak@klanderman.net \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).