Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Defining function based on alias
- X-seq: zsh-workers 40315
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Defining function based on alias
- Date: Sun, 8 Jan 2017 16:09:21 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=qC61HW4V1jSTXahNq/qsS+5SUk5oU0rYg3eD4OWUfkg=; b=mdkx1y4rV6bLzbGcPAEbNdEZdR6wA9fLUZhSWSycPgE/LWDlfPzXDfxOVArp4QSTaR UamilMtF/buqch20sLkOjWeEOhZ4WL80VO6qxZQLckhjvmMX8o45volpnLn5cPGIIMiI X9ZSz5Y8z4luHiI9AK4PFjgrCVajvObb0hNymw0+rorTy/+4VllPZsy9sCAiOm879ArT d02IgMCIdO6cegdnbUqCWest0+XtHF3L9t2l2zJCBwBTF/9E7hbIDEqcj/0prWkNrQLT nrptEGE56Te5KaE0+h/duD03BTfydD/e0sjPsoroHIEyUxB0vzRembaW9oA6kJ5SkCZO uIjw==
- In-reply-to: <20170108191922.3d3de59f@ntlworld.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20170107221659.1b9232da@ntlworld.com> <20170108191922.3d3de59f@ntlworld.com>
On Jan 8, 7:19pm, Peter Stephenson wrote:
}
} I am about to commit the following, which I hope will hope will stop
} people coming to grief with this common confusion. Please say if you
} see any problems.
OK, here's an unusual case ...
alias safely:foo='[[ -n $functions[foo] ]] || foo'
safely:foo() { echo this is foo only if no other foo }
I hesitate to suggest further convolutions, but maybe an option to the
alias command to "locally" switch on ALIAS_FUNC_DEF if it's actually
*meant* to be used that way?
Probably not very important.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author