zsh-users
 help / color / mirror / code / Atom feed
From: Marc Chantreux <khatar@phear.org>
To: zsh-users@zsh.org
Subject: make aliases work inside the function? (using a preprocessor?)
Date: Wed, 4 May 2016 13:46:32 +0000	[thread overview]
Message-ID: <20160504134632.GA5729@aurora-borealis.phear.org> (raw)

hello zsh people,

I have

    % which €
	€ () {
	setopt localoptions unset nowarncreateglobal
	"$@" }
    % which l
        l: aliased to print -l
    % € l error 
        €: command not found: l

sometimes i really need aliases.
sometimes aliases seems to work inside functions.
sometimes i made some hacks like

	eval "xx () { $functions[xx] }"

sometimes it works, sometimes it doesn't. i spend some time in the
manual to make up my mind about how to fix it.

i guess i'll use a preprocessor (m4?) and maybe even an existing lib
(m4sh?) to generate my zsh scripts. any ideas about it?

regards.
marc



             reply	other threads:[~2016-05-04 13:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-04 13:46 Marc Chantreux [this message]
2016-05-04 14:04 ` Peter Stephenson
2016-05-04 14:55 ` Oliver Kiddle
2016-05-04 17:21 ` Bart Schaefer
2016-05-09 12:30   ` Marc Chantreux

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=20160504134632.GA5729@aurora-borealis.phear.org \
    --to=khatar@phear.org \
    --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).