zsh-users
 help / color / mirror / code / Atom feed
* Perl completion problem
@ 2004-06-23  0:12 Daniel Muino
  2004-06-23  7:05 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Muino @ 2004-06-23  0:12 UTC (permalink / raw)
  To: zsh-users

I'm having a problem with zsh 4.2.0 and completing perl scripts file names.

If I set the file-sort to anything other than 'name' every time I hit <TAB> 
I get no matches for 'Perl script'

I.e.:

zstyle ':completion:*' file-sort name

perl <TAB> # works fine

zstyle ':completion:*' file-sort modification # or size, etc.

perl <TAB> # can't find 'Perl script'

If I remove the glob qualifiers from _perl:

-    '1:Perl script:_files -/ -g "*.(p[ml]|PL)(-.)"' \
+    '1:Perl script:_files -/ -g "*.(p[ml]|PL)"' \

It works fine under different file-sort options.

Any ideas why?

Thanks.

Daniel


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

* Re: Perl completion problem
  2004-06-23  0:12 Perl completion problem Daniel Muino
@ 2004-06-23  7:05 ` Bart Schaefer
  2004-06-23 18:45   ` Daniel Muino
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2004-06-23  7:05 UTC (permalink / raw)
  To: zsh-users

On Tue, 22 Jun 2004, Daniel Muino wrote:

> If I set the file-sort to anything other than 'name' every time I hit
> <TAB> I get no matches for 'Perl script'

There's a bug in the _path_files completion function.  See zsh-workers
article 19867, which refers back to 19839 and 19842.


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

* Re: Perl completion problem
  2004-06-23  7:05 ` Bart Schaefer
@ 2004-06-23 18:45   ` Daniel Muino
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Muino @ 2004-06-23 18:45 UTC (permalink / raw)
  To: zsh-users

On Wed, Jun 23, 2004 at 12:05:19AM -0700, Bart Schaefer wrote:
> On Tue, 22 Jun 2004, Daniel Muino wrote:
> 
> > If I set the file-sort to anything other than 'name' every time I hit
> > <TAB> I get no matches for 'Perl script'
> 
> There's a bug in the _path_files completion function.  See zsh-workers
> article 19867, which refers back to 19839 and 19842.
> 

Thanks Bart.

I'm using now a _path_files completion function that has PSW's patch, and it's
working great.

Daniel


--- _path_files.orig	2003-05-08 03:30:49.000000000 -0700
+++ _path_files	2004-06-23 11:43:37.000000000 -0700
@@ -120,7 +120,9 @@
 
     tmp2=()
     for tmp1 in "$pats[@]"; do
-      if [[ "$tmp1" = (#b)(*[^\$])(\(\([^\|~]##\)\)) ]]; then
+      if [[ "$tmp1" = (#b)(*[^\$])"(#q"(*)")" ]]; then
+	tmp2=( "$tmp2[@]" "${match[1]}(#q${sort}${match[2]})" )
+      elif [[ "$tmp1" = (#b)(*[^\$])(\(\([^\|~]##\)\)) ]]; then
         tmp2=( "$tmp2[@]" "${match[1]}((${sort}${match[2][3,-1]}" )
       elif [[ "$tmp1" = (#b)(*[^\$])(\([^\|~]##\)) ]]; then
         tmp2=( "$tmp2[@]" "${match[1]}(${sort}${match[2][2,-1]}" )
@@ -168,7 +170,9 @@
   fi
   tmp2=()
   for tmp1 in "$pats[@]"; do
-    if [[ "$tmp1" = (#b)(*[^\$])(\(\([^\|~]##\)\)) ]]; then
+    if [[ "$tmp1" = (#b)(*[^\$])"(#q"(*)")" ]]; then
+      tmp2=( "$tmp2[@]" "${match[1]}(#q${tmp3}${match[2]})" )
+    elif [[ "$tmp1" = (#b)(*[^\$])(\(\([^\|~]##\)\)) ]]; then
       tmp2=( "$tmp2[@]" "${match[1]}((${tmp3}${match[2][3,-1]}" )
     elif [[ "$tmp1" = (#b)(*[^\$])(\([^\|~]##\)) ]]; then
       tmp2=( "$tmp2[@]" "${match[1]}(${tmp3}${match[2][2,-1]}" )


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

end of thread, other threads:[~2004-06-23 18:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-23  0:12 Perl completion problem Daniel Muino
2004-06-23  7:05 ` Bart Schaefer
2004-06-23 18:45   ` Daniel Muino

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