zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@sunsite.dk
Subject: Re: While we're on the subject of zcompile ...
Date: Sat, 17 Apr 2004 23:08:53 +0200	[thread overview]
Message-ID: <11370.1082236133@athlon> (raw)
In-Reply-To: <1040413053246.ZM20004@candle.brasslantern.com>

On 13 Apr, Bart wrote:
> 
> I find the behavior of "zcompile -a" (with no arguments) to be extremely
> annoying.  There should be a way to say "dump all the functions you can,
> and ignore the ones that are already loaded or can't be loaded" rather
> than having it die entirely (blowing away the dump done so far) the first
> time it encounters an un-dumpable function.

It is annoying. I'd have thought it would make sense if `zcompile -c'
alone only attempted to dump loaded functions and `zcompile -a' only
attempted to dump not-loaded functions. Errors for functions which fail
to load are more reasonable, though.

> The questions are whether it's cur_add_func() that should be taught to
> ignore the error, or build_cur_dump(), and whether it should happen any
> time there are no arguments, or there should be a flag to cause errors
> to be ignored.

I'd vote for it happening any time.

The zcompile completion was not completing functions after -a and is
missing the fact that -k and -z options can be used more than once
between listed functions so below is an update. This also avoids the
irritating double filename completion.

Oliver

--- Completion/Zsh/Command/_zcompile	2001-04-02 13:32:47.000000000 +0200
+++ Completion/Zsh/Command/_zcompile	2004-04-17 23:03:57.000000000 +0200
@@ -3,23 +3,26 @@
 local state line expl curcontext="$curcontext" ret=1
 typeset -A opt_args
 
-_arguments -C -s -A "-*" -S \
-    '(-t -c -m -a)-U[don'\''t expand aliases]' \
+_arguments -C -s \
+    "(-t -c -m -a)-U[don't expand aliases]" \
     '(-t -M)-R[mark as read]' \
     '(-t -R)-M[mark as mapped]' \
-    '(-t -c -z -m -a)-k[ksh-style autoloading]' \
-    '(-t -c -k -m -a)-z[zsh-style autoloading]' \
+    '(-t -c -m -a)*-k[ksh-style autoloading]' \
+    '(-t -c -m -a)*-z[zsh-style autoloading]' \
     '(-t -U -z -k)-c[currently defined functions]' \
     '(-t -U -z -k)-m[use names as patterns]' \
     '(-t -U -z -k)-a[write autoload functions]' \
     '(-M -R -U -z -k -a -c -m)-t[show table of contents]' \
-    ':zwc file:_files' \
+    '(-M -R -U -a -c -m -t):file:->file' \
     '*:function:->function' && ret=0
 
-if (( $+opt_args[-c] )); then
+if [[ $state = function && -n $opt_args[(i)-[ac]] ]]; then
   _wanted functions expl 'function to write' compadd -k functions && ret=0
+elif [[ -n $opt_args[(i)-[tca]] ]]; then
+  _description files expl 'zwc file'
+  _files -g '*.zwc(-.)' "$expl[@]" && ret=0
 else
-  _description files expl 'zsh source file'
+  _description files expl 'file'
   _files "$expl[@]" && ret=0
 fi
 


  reply	other threads:[~2004-04-17 21:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-10 17:44 Compsys and KSH_AUTOLOAD Bart Schaefer
2004-04-12 14:00 ` Oliver Kiddle
2004-04-12 15:59   ` Bart Schaefer
2004-04-12 21:43     ` Oliver Kiddle
2004-04-13  5:32       ` While we're on the subject of zcompile Bart Schaefer
2004-04-17 21:08         ` Oliver Kiddle [this message]
2004-04-13  5:38       ` Compsys and KSH_AUTOLOAD Bart Schaefer
2004-04-13 15:29         ` PATCH: " Oliver Kiddle
2004-04-13 17:51           ` Bart Schaefer
2004-04-16 16:49             ` Oliver Kiddle
2004-04-16 17:25               ` Bart Schaefer
2004-04-18 13:46                 ` Oliver Kiddle
2004-04-16 17:30               ` Bart Schaefer
2004-04-17 19:51                 ` Oliver Kiddle
2004-04-19  0:14                   ` Bart Schaefer
2004-04-19 10:18                     ` Oliver Kiddle
2004-04-20  4:11                       ` Bart Schaefer
2004-04-20 10:08                         ` Oliver Kiddle
2004-04-14  5:04           ` Bart Schaefer
2004-04-14 19:55 ` Peter Stephenson

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=11370.1082236133@athlon \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@sunsite.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).