zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@zsh.org
Subject: Re: Update to _files in 27780 breaks chmod completion
Date: Thu, 18 Mar 2010 17:59:08 +0000	[thread overview]
Message-ID: <201003181759.o2IHx81I017112@news01.csr.com> (raw)
In-Reply-To: <20100318174942.GA1373@ruderich.org>

Simon Ruderich wrote:
> On Thu, Mar 18, 2010 at 05:04:17PM +0000, Peter Stephenson wrote:
> > If you read that message, you'll find that's exactly what *didn't* work
> > for me before and *does* work now (as I just confirmed again).
> >
> > Are you sure you've got the latest executable as well as the latest
> > functions?  The code changed in the patch for users/14905.
> 
> Ah, that's the problem. I'm using Zsh 4.3.6 with a current
> checkout of the completion functions. Until now that always
> worked perfectly.
> 
> Is there any chance this can still be supported or should I just
> unapply the patch locally?

Generally there's never any guarantee that functions with one
distribution will work with another, since in all "production"
installations this isn't an issue as $fpath is set appropriately.

However, I think the following should work in both versions and I'd be
interested to hear about it going wrong...  In fact I'm not sure why the
code uses ":gs" instead off "//" which is a more obvious operator at
this point.  Possibly the latter used to be flakey.

Index: Completion/Unix/Type/_files
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_files,v
retrieving revision 1.12
diff -p -u -r1.12 _files
--- Completion/Unix/Type/_files	15 Mar 2010 10:19:38 -0000	1.12
+++ Completion/Unix/Type/_files	18 Mar 2010 17:56:11 -0000
@@ -90,7 +90,7 @@ fi
 
 tried=()
 for def in "$pats[@]"; do
-  eval "def=( ${${def:gs/\\:/\\\\\\:}//(#b)([][()|*?^#~<>])/\\${match[1]}} )"
+  eval "def=( ${${def//\\:/\\\\\\:}//(#b)([][()|*?^#~<>])/\\${match[1]}} )"
 
   tmp="${(@M)def#*[^\\]:}"
   (( $tried[(I)${(q)tmp}] )) && continue


-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


  reply	other threads:[~2010-03-18 17:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-18 16:30 Simon Ruderich
2010-03-18 17:04 ` Peter Stephenson
2010-03-18 17:49   ` Simon Ruderich
2010-03-18 17:59     ` Peter Stephenson [this message]
2010-03-18 20:10       ` Simon Ruderich

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=201003181759.o2IHx81I017112@news01.csr.com \
    --to=pws@csr.com \
    --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).