zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: ksh_autoload safety cleanup
Date: Fri, 11 Jul 2008 20:26:36 +0100	[thread overview]
Message-ID: <20080711202636.374ec266@pws-pc> (raw)
In-Reply-To: <20080711083203.GA51766@redoubt.spodhuis.org>

On Fri, 11 Jul 2008 01:32:03 -0700
Phil Pennock <zsh-workers+phil.pennock@spodhuis.org> wrote:
> I'd naively interpret that to mean that the ksh_autoload setting at the
> time of the autoload/typeset determines it, rather than the value at the
> time the function is eventually loaded.  I'm not convinced that the
> current behaviour is correct and am wondering if the -k/-z should be
> implicitly provided instead.  Is there any situation where declaring
> autoload in one mode and then loading later in the other mode is likely
> to be correct and/or desired?

I don't imagine so, but the option was only designed as a single global
setting so that users wouldn't need to think about it, so it's not
surprising it doesn't work very well as a dynamic option and it's
probably too late to change.  If you use both regularly you need the
flags.

You can in any case already handle this along the lines of (this
isn't a complete replacement but it gives you the idea):

autoload() {
  if [[ -o kshautoload ]]; then
    builtin autoload -k "$@"
  else
    builtin autoload -z "$@"
  fi
}

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



      reply	other threads:[~2008-07-11 19:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-11  8:32 Phil Pennock
2008-07-11 19:26 ` Peter Stephenson [this message]

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=20080711202636.374ec266@pws-pc \
    --to=p.w.stephenson@ntlworld.com \
    --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).