zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: completers using zstat don't work with zmodload -F zsh/stat
Date: Wed, 27 Jul 2011 20:24:08 +0200	[thread overview]
Message-ID: <CAHYJk3RQaPHsLOf+0ON89Miqmh6gXH9ubtzxz7X3tY_LSLfMtw@mail.gmail.com> (raw)
In-Reply-To: <110727111829.ZM22827@torch.brasslantern.com>

On 27 July 2011 20:18, Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Jul 27,  6:44pm, Mikael Magnusson wrote:
> } Subject: Re: completers using zstat don't work with zmodload -F zsh/stat
> }
> } # alias zstat='builtin stat'
> } # rm $fpath[3].zwc*
> } removed `/usr/local/share/zsh/4.3.12-dev-1/functions.zwc'
> } removed `/usr/local/share/zsh/4.3.12-dev-1/functions.zwc.old'
> } # for a ($fpath) {[ -w $a:r -a $a/_*(N[1]) ] && zrecompile -p -U -z
> } $a.zwc $a/_*}
> } re-compiling /usr/local/share/zsh/4.3.12-dev-1/functions.zwc: succeeded
> }
> } % umount <tab>
> } _canonical_paths_add_paths:6: no such builtin: stat
>
> This must be happening because _canonical_paths_add_paths isn't actually
> defined until _canonical_paths is executed, so the -U option to zcompile
> doesn't have a chance to come into effect.
>
> This is going to be a problem with any completion source file that has
> multiple embedded function definitions.
>
> It MIGHT help to both use "zcompile -a" and also change _canonical_paths
> from using
>
>    _canonical_paths_add_paths () {
>      ...
>    }
>
> to using the load-once paradigm
>
>    (( $+functions[__canonical_paths_add_paths] )) ||
>    _canonical_paths_add_paths () {
>      ...
>    }
>
> but I'm not confident of that.

Hm, but if it's only loaded at "runtime", why does the alias get
expanded then? My user doesn't have the zstat alias. Are aliases still
expanded during compilation inside function definitions but -U is
somehow not active? (This sounds odd).

-- 
Mikael Magnusson


  reply	other threads:[~2011-07-27 18:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26 19:09 Mikael Magnusson
2011-07-27  8:20 ` Bart Schaefer
2011-07-27  9:04   ` Mikael Magnusson
2011-07-27 16:38     ` Bart Schaefer
2011-07-27 16:44       ` Mikael Magnusson
2011-07-27 18:18         ` Bart Schaefer
2011-07-27 18:24           ` Mikael Magnusson [this message]
2011-07-27 19:32             ` Bart Schaefer

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=CAHYJk3RQaPHsLOf+0ON89Miqmh6gXH9ubtzxz7X3tY_LSLfMtw@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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).