Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: sourcing a sh file in zsh
- X-seq: zsh-workers 26332
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: sourcing a sh file in zsh
- Date: Fri, 16 Jan 2009 19:59:23 -0800
- Cc: zsh-workers@xxxxxxxxxx
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=d200807; d=spodhuis.org; h=Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=cZDJhgM16inN67uZYbu9GC2Ve97o35tIza3mSnUR59j3++Hr3DFX0zShMfkx4cKaq1aATkkzupVK8KCVXKiMUF0T/FKx102QsGpqRaa3A/fK4FdGZrJ51RXQ5SUoregHp3HeJNUG89clo+x88A7CBXKVvE5ZA1aiWo8EgA4wH4g=;
- In-reply-to: <090116102934.ZM22119@xxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <BD9D2405-AD6A-4336-9C8A-85149165B6B8@xxxxxxxxx> <090116075615.ZM21871@xxxxxxxxxxxxxxxxxxxxxx> <200901161939.54651.arvidjaar@xxxxxxxxxx> <090116102934.ZM22119@xxxxxxxxxxxxxxxxxxxxxx>
On 2009-01-16 at 10:29 -0800, Bart Schaefer wrote:
> with the obvious meaning of "turn on sh emulation while sourcing" and
> would otherwise behave like "source". Might need a variant that has
> the path-searching semantics of "." as well.
Isn't there a problem where a function is defined which assumes one set
of semantics and the reset afterwards changes the semantics? Thus the
reason why the entry points into completion set the relevant emulation
options.
Really, we need to be able to have a function "remember" the options in
effect at the time it was defined and restore them, without having to
call emulate within them.
At $work there are some shell libraries which I could use if this were
doable, which is why my notes of Things I Want To Get Around To Making
Zsh Support includes this item:
----------------------------8< cut here >8------------------------------
zsh setopt inherit_options
When set, functions defined remember the options set at time of definition,
so it's similar to an automatic "emulate" in them.
Most usefully: setopt local_options inherit_options
function fred { setopt localoptions shwordsplit; alpha="foo bar baz bat"; print -l $alpha; function barney { print -l $alpha } }
(Multi-shell compatibility libraries)
----------------------------8< cut here >8------------------------------
Thoughts, comments?
I can see how to go about doing it but haven't gotten around to it yet.
-Phil
Messages sorted by:
Reverse Date,
Date,
Thread,
Author