zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: real time alias?
Date: Sun, 18 Mar 2018 16:01:07 -0700	[thread overview]
Message-ID: <180318160107.ZM8955@torch.brasslantern.com> (raw)
In-Reply-To: <f97012ca-0648-965b-7999-182117252769@eastlink.ca>

On Mar 16, 11:56am, Ray Andrews wrote:
}
} I get it.  The function can't 'grab' a new version of the alias without 
} recompiling itself which ends up being far more trouble than it's 
} worth.  Mind, my functions do know where they came from:
} 
}      (1)TYPE: c is a shell function from /aWorking/Zsh/Source/c:

Sure, but it doesn't keep track of whether "c" is the ONLY function
that came from that file.  It wouldn't be safe to automatically re-
source just any such file.  Telling zsh which files can be sourced
that way is the job of "autoload".

It would be possible for every function to know whether it originally
came in via "autoload" and have some criteria for whether to discard
the current definition and re-load again.  However, given the possible
chain of dependencies (this alias depends on that function depends on
some other alias depends on ...) it isn't practical to keep track of
everything that might have gone into the definition of a function.

Besides, we generally recommend NOT depending on aliases in autoloaded
functions, and therefore using "autoload -U ...".

Maybe this is a feature that Sebastian is interested in tackling in his
plugin manager:  Remembering functions that are autoloaded *without* -U
in plugins that define aliases, and reloading them if the aliases are
updated.  Although it does seem ripe for unintended side-effects.


  reply	other threads:[~2018-03-18 23:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-15 17:51 Ray Andrews
2018-03-15 17:57 ` Jérémie Roquet
2018-03-15 18:13   ` Ray Andrews
2018-03-15 21:44     ` Marc Chantreux
2018-03-15 21:46       ` Marc Chantreux
2018-03-16 17:19         ` Justin M Wozniak
2018-03-16 17:41           ` Ray Andrews
2018-03-17 16:00             ` Marc Chantreux
2018-03-16 17:51           ` Marc Chantreux
2018-03-16 16:47       ` Ray Andrews
2018-03-16 17:41         ` Marc Chantreux
2018-03-16 18:13         ` Bart Schaefer
2018-03-16 18:56           ` Ray Andrews
2018-03-18 23:01             ` Bart Schaefer [this message]
2018-03-19  0:05               ` Ray Andrews
2018-03-17 23:17       ` Bart Schaefer
     [not found] <98aa0638-97ed-dfe0-8dd2-39129d02c084__39937.2481661432$1521136270$gmane$org@eastlink.ca>
2018-03-17 22:47 ` Stephane Chazelas
2018-03-18  3:20   ` Ray Andrews

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=180318160107.ZM8955@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@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).