help / color / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: A way to write type-agnostic script/function runnables
Date: Thu, 5 Dec 2019 12:15:09 +0100
Message-ID: <CAKc7PVAa7FW9fhiRW0vn_HMnam5kr4wm7G8LYf5hba0MEBZx1A@mail.gmail.com> (raw)
In-Reply-To: <CAKc7PVCy_yUz6Yrxn6xprKohBP=o_zj-pRnJVY-tdsdx=gf3wg@mail.gmail.com>

On Mon, 25 Nov 2019 at 15:22, Sebastian Gniazdowski
<sgniazdowski@gmail.com> wrote:
> I wonder if one could get the directory where the function is being
> located directly, without the global *_DIR parameter? Without use of
> the $*trace parameters (I don't trust them;).

I've had a thought: it shouldn't be an uncomfortable thing to use
shell's features → if the object is being run as a function, then it
has access to the in-session parameters – and why hesitate to leverage
this? So in short, the PLUGIN_NAME_DIR parameter is a good solution,
there's no need for querying the autoload's storage directory.

Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25 14:22 Sebastian Gniazdowski
2019-12-05 11:15 ` Sebastian Gniazdowski [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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKc7PVAa7FW9fhiRW0vn_HMnam5kr4wm7G8LYf5hba0MEBZx1A@mail.gmail.com \
    --to=sgniazdowski@gmail.com \
    --cc=zsh-users@zsh.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link


Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-users

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git