about summary refs log tree commit diff
path: root/Doc
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-03-15 23:33:19 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-03-15 23:33:19 -0700
commit7e994fe145cd5beaadf8719468bbd682c17512b5 (patch)
tree843c2e4976e02e33de86c38dfb3f26c705ce9c85 /Doc
parent205cb16b98793c0db797b6f1a76492854a4afb55 (diff)
downloadzsh-7e994fe145cd5beaadf8719468bbd682c17512b5.tar.gz
zsh-7e994fe145cd5beaadf8719468bbd682c17512b5.tar.xz
zsh-7e994fe145cd5beaadf8719468bbd682c17512b5.zip
34712: clarify words that may be aliased
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Zsh/grammar.yo20
1 files changed, 18 insertions, 2 deletions
diff --git a/Doc/Zsh/grammar.yo b/Doc/Zsh/grammar.yo
index 63d90dfd0..b30e423e1 100644
--- a/Doc/Zsh/grammar.yo
+++ b/Doc/Zsh/grammar.yo
@@ -532,12 +532,12 @@ characters up to a newline to be ignored.
 texinode(Aliasing)(Quoting)(Comments)(Shell Grammar)
 sect(Aliasing)
 cindex(aliasing)
-Every token in the shell input is checked to see if there
+Every eligible em(word) in the shell input is checked to see if there
 is an alias defined for it.
 If so, it is replaced by the text of the alias if it is in command
 position (if it could be the first word of a simple command),
 or if the alias is global.
-If the text ends with a space, the next word in the shell input
+If the replacement text ends with a space, the next word in the shell input
 is treated as though it were in command position for purposes of alias
 expansion.
 findex(alias, use of)
@@ -545,6 +545,22 @@ cindex(aliases, global)
 An alias is defined using the tt(alias) builtin; global aliases
 may be defined using the tt(-g) option to that builtin.
 
+A em(word) is defined as:
+
+startitemize()
+itemiz(Any plain string or glob pattern)
+itemiz(Any quoted string, using any quoting method (note that the quotes
+must be part of the alias definition for this to be eligible))
+itemiz(Any parameter reference or command substitution)
+itemiz(Any series of the foregoing, concatenated without whitespace or
+other tokens between them)
+itemiz(Any reserved word (tt(case), tt(do), tt(else), etc.))
+enditemize()
+
+Reserved words are not eligible for aliasing when tt(POSIX_ALIASES) is set.
+The tt(alias) builtin does not reject ineligible aliases, but they are not
+expanded.
+
 Alias expansion is done on the shell input before any other expansion
 except history expansion.  Therefore, if an alias is defined for the
 word tt(foo), alias expansion may be avoided by quoting part of the