From: Vincent Bernat <bernat@luffy.cx>
To: "René Neumann" <lists@necoro.eu>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Alias named '='
Date: Sun, 08 Oct 2017 10:29:02 +0200 [thread overview]
Message-ID: <m360bqt54h.fsf@luffy.cx> (raw)
In-Reply-To: <6e3f43ea-45b0-d6a8-43b9-18845ea4edc9@necoro.eu> (=?utf-8?Q?=22Ren=C3=A9?= Neumann"'s message of "Sun, 8 Oct 2017 10:03:52 +0200")
❦ 8 octobre 2017 10:03 +0200, René Neumann <lists@necoro.eu> :
> I stumbled upon the idea to define a function '=' to have an inline
> calculator in zsh [1].
>
> As multiplication is a normal operation, I also want 'noglob' behavior.
> There seems to be no way of defining this for a function (or is there?),
> so the only way would be to haven an alias
> alias '='='noglob ='
>
> But this seems to not be possible, yielding 'bad assignment': The alias
> command seems to hard-parse until the first equal-sign -- even tricks like
> alias $'\u3D'='noglob ='
> do not work.
I am using "c" instead of "=", but you can use "=" with:
aliases[=]='noglob ='
--
Use the "telephone test" for readability.
- The Elements of Programming Style (Kernighan & Plauger)
next prev parent reply other threads:[~2017-10-08 8:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-08 8:03 René Neumann
2017-10-08 8:29 ` Vincent Bernat [this message]
2017-10-08 10:57 ` René Neumann
2017-10-08 18:37 ` Daniel Shahaf
2017-10-08 22:37 ` 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=m360bqt54h.fsf@luffy.cx \
--to=bernat@luffy.cx \
--cc=lists@necoro.eu \
--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).