From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: [PATCH] type -w += global aliases
Date: Wed, 20 Dec 2017 05:36:12 +0000 [thread overview]
Message-ID: <20171220053612.9357-1-danielsh@tarpaulin.shahaf.local2> (raw)
Follow-up to 36403, which did the same for suffix aliases.
---
Src/hashtable.c | 2 ++
Test/A02alias.ztst | 11 +++++++++++
2 files changed, 13 insertions(+)
diff --git a/Src/hashtable.c b/Src/hashtable.c
index 6ec2ed220..b7baa3142 100644
--- a/Src/hashtable.c
+++ b/Src/hashtable.c
@@ -1261,6 +1261,8 @@ printaliasnode(HashNode hn, int printflags)
if (printflags & PRINT_WHENCE_WORD) {
if (a->node.flags & ALIAS_SUFFIX)
printf("%s: suffix alias\n", a->node.nam);
+ else if (a->node.flags & ALIAS_GLOBAL)
+ printf("%s: global alias\n", a->node.nam);
else
printf("%s: alias\n", a->node.nam);
return;
diff --git a/Test/A02alias.ztst b/Test/A02alias.ztst
index e68e93e0d..99f7aae26 100644
--- a/Test/A02alias.ztst
+++ b/Test/A02alias.ztst
@@ -137,3 +137,14 @@
thisworks)
0:NO_ALIAS_FUNC_DEF works if the alias is a complete definition
>That worked
+
+ type \bar
+ type -w \bar
+ type \\bar
+ type -w \\bar
+0:type -w of alias -g
+>bar is a global alias for echo
+>bar: global alias
+>\bar is an alias for echo
+>\bar: alias
+
reply other threads:[~2017-12-20 5:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20171220053612.9357-1-danielsh@tarpaulin.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--cc=zsh-workers@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).