zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: _zcompile and _autoload
Date: Thu, 30 Mar 2000 10:10:22 +0200 (MET DST)	[thread overview]
Message-ID: <200003300810.KAA23996@beta.informatik.hu-berlin.de> (raw)


Here is completion for zcompile and an update for _autoload.

It's a pity that the functions in Builtins are older than _arguments...

And a small fix in _path_files.

Bye
 Sven

diff -ru ../z.old/Completion/Builtins/_autoload Completion/Builtins/_autoload
--- ../z.old/Completion/Builtins/_autoload	Thu Mar 30 09:58:41 2000
+++ Completion/Builtins/_autoload	Thu Mar 30 10:04:16 2000
@@ -2,4 +2,9 @@
 
 local expl
 
-_wanted functions expl 'shell function' compadd - ${^fpath}/*(N:t)
+if (( $words[(I)[-+]*w*] )); then
+  _description files expl 'zwc file'
+  _files "$expl[@]" -g '*.zwc'
+else
+  _wanted functions expl 'shell function' compadd - ${^fpath}/*(N:t)
+fi
diff -ru ../z.old/Completion/Builtins/_zcompile Completion/Builtins/_zcompile
--- ../z.old/Completion/Builtins/_zcompile	Thu Mar 30 10:05:46 2000
+++ Completion/Builtins/_zcompile	Thu Mar 30 10:09:02 2000
@@ -0,0 +1,22 @@
+#compdef zcompile
+
+local context state line expl
+typeset -A opt_args
+
+_arguments -s \
+    '(-c -m -a)-U[don'\''t expand aliases]' \
+    '(-M)-R[mark as read]' \
+    '(-R)-M[mark as mapped]' \
+    '(-c -z -m -a)-k[ksh-style autoloading]' \
+    '(-c -k -m -a)-z[zsh-style autoloading]' \
+    '(-U -z -k)-c[currently defined functions]' \
+    '(-U -z -k)-m[use names as patterns]' \
+    '(-U -z -k)-a[write autoload functions]' \
+    ':zwc file:_files' \
+    '*:function:->function' && return 0
+
+if (( $+opt_args[-c] )); then
+  _wanted functions expl 'function to write' compadd - ${(k)functions}
+else
+  _wanted file expl 'zsh source file' _files
+fi
diff -ru ../z.old/Completion/Core/_path_files Completion/Core/_path_files
--- ../z.old/Completion/Core/_path_files	Thu Mar 30 09:58:49 2000
+++ Completion/Core/_path_files	Thu Mar 30 10:07:22 2000
@@ -528,7 +528,8 @@
 # them as possible matches.
 
 if zstyle -t ":completion:${curcontext}:paths" expand prefix &&
-   [[ nm -eq compstate[nmatches] && $#exppaths -ne 0 ]]; then
+   [[ nm -eq compstate[nmatches] && $#exppaths -ne 0 &&
+      "$exppaths" != "$eorig" ]]; then
   PREFIX="${opre}"
   SUFFIX="${osuf}"
   compadd -Q "$mopts[@]" -S '' -M "r:|/=* r:|=*" -p "$linepath" - "$exppaths[@]"

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


             reply	other threads:[~2000-03-30  8:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-30  8:10 Sven Wischnowsky [this message]
2000-03-31 17:12 ` Oliver Kiddle

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=200003300810.KAA23996@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).