zsh-workers
 help / color / mirror / code / Atom feed
* Update to _files in 27780 breaks chmod completion
@ 2010-03-18 16:30 Simon Ruderich
  2010-03-18 17:04 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Ruderich @ 2010-03-18 16:30 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

Hello all,

The change to _files in 27780 somehow broke completion for chmod.
Before I could complete the files, but now I don't get any files.
To reproduce:

    zsh -f
    % autoload -U compinit && compinit
    % zstyle ':completion:*' format '%d:'
    % chmod +x <tab>
      `file' or `):globbed-files':

I'm not sure if other commands are affected as well.

Thanks,
Simon
-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Update to _files in 27780 breaks chmod completion
  2010-03-18 16:30 Update to _files in 27780 breaks chmod completion Simon Ruderich
@ 2010-03-18 17:04 ` Peter Stephenson
  2010-03-18 17:49   ` Simon Ruderich
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2010-03-18 17:04 UTC (permalink / raw)
  To: zsh-workers

Simon Ruderich wrote:
> The change to _files in 27780 somehow broke completion for chmod.
> Before I could complete the files, but now I don't get any files.
> To reproduce:
> 
>     zsh -f
>     % autoload -U compinit && compinit
>     % zstyle ':completion:*' format '%d:'
>     % chmod +x <tab>
>       `file' or `):globbed-files':

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.

-- 
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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Update to _files in 27780 breaks chmod completion
  2010-03-18 17:04 ` Peter Stephenson
@ 2010-03-18 17:49   ` Simon Ruderich
  2010-03-18 17:59     ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Ruderich @ 2010-03-18 17:49 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 698 bytes --]

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?

Thanks,
Simon
-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Update to _files in 27780 breaks chmod completion
  2010-03-18 17:49   ` Simon Ruderich
@ 2010-03-18 17:59     ` Peter Stephenson
  2010-03-18 20:10       ` Simon Ruderich
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2010-03-18 17:59 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Update to _files in 27780 breaks chmod completion
  2010-03-18 17:59     ` Peter Stephenson
@ 2010-03-18 20:10       ` Simon Ruderich
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Ruderich @ 2010-03-18 20:10 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

On Thu, Mar 18, 2010 at 05:59:08PM +0000, Peter Stephenson wrote:
> 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.

Thank you very much, this works perfectly.

Simon
-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-18 20:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-18 16:30 Update to _files in 27780 breaks chmod completion Simon Ruderich
2010-03-18 17:04 ` Peter Stephenson
2010-03-18 17:49   ` Simon Ruderich
2010-03-18 17:59     ` Peter Stephenson
2010-03-18 20:10       ` Simon Ruderich

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).