zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: RE: Something strange with matcher
Date: Thu, 23 Mar 2000 12:49:04 +0100 (MET)	[thread overview]
Message-ID: <200003231149.MAA23456@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Andrej Borsenkow"'s message of Thu, 23 Mar 2000 13:59:33 +0300


Andrej Borsenkow wrote:

> > > Funnily, matcher for cd still works so I suspect now `files' tag is
> > > treated differently?
> > 
> > Yes, cleaner. Actually, I'm a bit suprised that it worked 
> > before, that 
> > wasn't really planned.
> > 
> > Anyway, as _complete_help could have told you:
> > 
> 
> Ahem ... but I did try complete help
> 
> bor@itsrm2% l 
> tags in context :completion::complete:ls::
>       files     (_default)
>       all-files (_files _default)

;-) I know the output. But I also knew that _default doesn't look up
the styles (i.e. it doesn't call _description).

Latter tags take precedence over earlier ones, so to say.

For this case, the fix would be easy, but I'm sure that they are other 
places in the completion system where this would then have to be
changed. Too many places to make it seem worthwhile to try...


Anyway, this made me notice that I had overlooked some direct calls to 
_path_files, which now need the tag-alias-loop.

Bye
 Sven

diff -ru ../z.old/Completion/Builtins/_cd Completion/Builtins/_cd
--- ../z.old/Completion/Builtins/_cd	Thu Mar 23 10:44:29 2000
+++ Completion/Builtins/_cd	Thu Mar 23 12:37:32 2000
@@ -34,7 +34,7 @@
   if [[ -o cdablevars && -n "$PREFIX" && ! -d ${tdir::=${PREFIX%%/*}} &&
         -d ${~tdir2::="~$tdir"} ]]; then
       PREFIX="~$PREFIX"
-      _path_files -/
+      _wanted directories expl directory _path_files -/
   else
     local tmpcdpath
     tmpcdpath=(${(@)cdpath:#.})
@@ -43,5 +43,5 @@
 	"path-directories:directories in cdpath:_path_files -W tmpcdpath -/"
   fi
 else
-  _path_files -/
+  _wanted directories expl directory _path_files -/
 fi
diff -ru ../z.old/Completion/Builtins/_zstyle Completion/Builtins/_zstyle
--- ../z.old/Completion/Builtins/_zstyle	Thu Mar 23 10:44:32 2000
+++ Completion/Builtins/_zstyle	Thu Mar 23 12:39:26 2000
@@ -47,7 +47,7 @@
   numbers		 c:bool
   original		 c:bool
   packageset		 c:packageset
-  path			 'c:_path_files -/'
+  path			 'c:_wanted directories expl directory _path_files -/'
   ports			 c:_ports
   prefer-ignored         c:bool
   prefix-hidden		 c:bool
diff -ru ../z.old/Completion/User/_pbm Completion/User/_pbm
--- ../z.old/Completion/User/_pbm	Thu Mar 23 10:44:42 2000
+++ Completion/User/_pbm	Thu Mar 23 12:46:50 2000
@@ -17,11 +17,8 @@
 fi
   
 if [[ $# -ne 0 || $+_in_pbm -ne 0 ]]; then
-  if (( ! $# )); then
-    _description files expl 'picture file'
-    set -- "$expl[@]"
-  fi
-  _path_files "$@" -g "$pat" || _files "$@" -g '*.(#i)p[bgp]m'
+  _wanted files expl 'picture file' _path_files "$@" -g "$pat" - ||
+      _files "$@" "$expl[@]" -g '*.(#i)p[bgp]m'
   return
 fi
 
@@ -772,6 +769,6 @@
   ;;
 
 *)
-  _description files expl 'picture file'
-  _path_files "$expl[@]" -g "$pat" || _files "$expl[@]" -g '*.(#i)p[bgp]m'
+  _wanted files expl 'picture file' _path_files -g "$pat" ||
+      _files "$expl[@]" -g '*.(#i)p[bgp]m'
 esac
diff -ru ../z.old/Completion/User/_pspdf Completion/User/_pspdf
--- ../z.old/Completion/User/_pspdf	Thu Mar 23 10:44:43 2000
+++ Completion/User/_pspdf	Thu Mar 23 12:45:32 2000
@@ -6,7 +6,6 @@
 #  gs gsbj gsdj gsdj500 gslj gslp gsnd ps2ascii
 
 _ps && ret=0
-_description files expl 'PDF file'
-_path_files "$expl[@]" -g '*.(#i)pdf'
+_wanted files expl 'PDF file' _path_files -g '*.(#i)pdf'
 
 return ret
diff -ru ../z.old/Completion/User/_tiff Completion/User/_tiff
--- ../z.old/Completion/User/_tiff	Thu Mar 23 10:44:44 2000
+++ Completion/User/_tiff	Thu Mar 23 12:46:48 2000
@@ -13,7 +13,8 @@
     _description files expl 'picture file'
     set -- "$expl[@]"
   fi
-  _path_files "$@" -g "$pat" || _files "$@" -g '*.(#i)tiff'
+  _wanted files expl 'picture file' _path_files "$@" -g "$pat" - ||
+      _files "$@" "$expl[@]" -g '*.(#i)tiff'
   return
 fi
 
diff -ru ../z.old/Completion/User/_zdump Completion/User/_zdump
--- ../z.old/Completion/User/_zdump	Thu Mar 23 10:44:45 2000
+++ Completion/User/_zdump	Thu Mar 23 12:47:43 2000
@@ -6,4 +6,4 @@
 
 _arguments '-v[lowest possible]' \
            '-c[cutoff]:cutoff year:' \
-           '*:timezone:_path_files -W $_zoneinfo_dirs'
+           '*:timezone:_files -W _zoneinfo_dirs'

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


                 reply	other threads:[~2000-03-23 11:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200003231149.MAA23456@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).