From: Phil Pennock <phil@athenaeum.demon.co.uk>
To: zsh-workers@math.gatech.edu
Subject: Docs fix
Date: Mon, 26 Oct 1998 23:03:47 +0000 (GMT) [thread overview]
Message-ID: <199810262303.XAA00552@athenaeum.demon.co.uk> (raw)
Quick docs fix; fairly trivial.
The first one is just some stuff for the FAQ about $* vs "$@"
The second one is a couple of fixes for grammar.yo -- a typo and a
semantic flaw.
They're both small, so in just one mail. I think you can just stick two
diffs together the way I have ...
-Phil
-----------------------------< cut here >-------------------------------
*** Etc/FAQ.yo.old Wed Apr 29 00:50:21 1998
--- Etc/FAQ.yo Thu Oct 15 23:25:21 1998
***************
*** 687,698 ****
)
can be replaced by the zsh function,
verb(
! cd() { builtin cd $*; echo $PWD; }
)
(the `builtin' tells zsh to use its own `cd', avoiding an infinite loop)
or, perhaps better,
verb(
! cd() { builtin cd $*; print -D $PWD; }
)
(which converts your home directory to a tt(~)). In fact, this problem is
better solved by defining the special function chpwd() (see the manual).
--- 687,698 ----
)
can be replaced by the zsh function,
verb(
! cd() { builtin cd "$@"; echo $PWD; }
)
(the `builtin' tells zsh to use its own `cd', avoiding an infinite loop)
or, perhaps better,
verb(
! cd() { builtin cd "$@"; print -D $PWD; }
)
(which converts your home directory to a tt(~)). In fact, this problem is
better solved by defining the special function chpwd() (see the manual).
***************
*** 704,719 ****
SETCOUNTER(XXenumcounter)(0)
enumerate(
myeit() If the csh alias references "parameters" (tt(\!:1), tt(\!*) etc.),
! then in zsh you need a function (referencing tt($1), tt($*) etc.).
Otherwise, you can use a zsh alias.
myeit() If you use a zsh function, you need to refer _at_least_ to
! tt($*) in the body (inside the tt({ })). Parameters don't magically
appear inside the tt({ }) the way they get appended to an alias.
myeit() If the csh alias references its own name (tt(alias rm "rm -i")),
then in a zsh function you need the "command" keyword
! (function tt(rm() { command rm -i $* })), but in a zsh alias
you don't (tt(alias rm="rm -i")).
myeit() If you have aliases that refer to each other (tt(alias ls "ls -C";
--- 704,719 ----
SETCOUNTER(XXenumcounter)(0)
enumerate(
myeit() If the csh alias references "parameters" (tt(\!:1), tt(\!*) etc.),
! then in zsh you need a function (referencing tt($1), tt($*) or tt("$@") etc.).
Otherwise, you can use a zsh alias.
myeit() If you use a zsh function, you need to refer _at_least_ to
! tt($*) or tt("$@") in the body (inside the tt({ })). Parameters don't magically
appear inside the tt({ }) the way they get appended to an alias.
myeit() If the csh alias references its own name (tt(alias rm "rm -i")),
then in a zsh function you need the "command" keyword
! (function tt(rm() { command rm -i "$@" })), but in a zsh alias
you don't (tt(alias rm="rm -i")).
myeit() If you have aliases that refer to each other (tt(alias ls "ls -C";
***************
*** 766,772 ****
There is one other serious problem with aliases: consider
verb(
alias l='/bin/ls -F'
! l() { /bin/ls -la $* | more }
)
mytt(l) in the function definition is in command position and is expanded
as an alias, defining mytt(/bin/ls) and mytt(-F) as functions which call
--- 766,772 ----
There is one other serious problem with aliases: consider
verb(
alias l='/bin/ls -F'
! l() { /bin/ls -la "$@" | more }
)
mytt(l) in the function definition is in command position and is expanded
as an alias, defining mytt(/bin/ls) and mytt(-F) as functions which call
*** Doc/Zsh/grammar.yo.old Thu Oct 15 23:28:26 1998
--- Doc/Zsh/grammar.yo Thu Oct 15 23:35:11 1998
***************
*** 117,123 ****
cindex(for loops)
cindex(loops, for)
item(tt(for) var(name) [ tt(in) var(word) ... var(term) ] tt(do) var(list) tt(done))(
! where var(term) is one ore more newline or tt(;).
Expand the list of var(word)s, and set the parameter
var(name) to each of them in turn, executing
var(list) each time. If the tt(in) var(word) is omitted,
--- 117,123 ----
cindex(for loops)
cindex(loops, for)
item(tt(for) var(name) [ tt(in) var(word) ... var(term) ] tt(do) var(list) tt(done))(
! where var(term) is one or more newline or tt(;).
Expand the list of var(word)s, and set the parameter
var(name) to each of them in turn, executing
var(list) each time. If the tt(in) var(word) is omitted,
***************
*** 211,217 ****
cindex(testing conditional expression)
item(tt([[) var(exp) tt(]]))(
Evaluates the conditional expression var(exp)
! and return a zero exit status if it is true.
See noderef(Conditional Expressions)
for a description of var(exp).
)
--- 211,217 ----
cindex(testing conditional expression)
item(tt([[) var(exp) tt(]]))(
Evaluates the conditional expression var(exp)
! and return a zero exit status iff it is true.
See noderef(Conditional Expressions)
for a description of var(exp).
)
next reply other threads:[~1998-10-26 23:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-10-26 23:03 Phil Pennock [this message]
1998-10-26 23:53 ` Bart Schaefer
1998-10-27 1:25 ` Zoltan Hidvegi
1998-10-27 2:27 ` Bart Schaefer
1998-10-26 22:02 ` TGAPE!
1998-10-27 4:05 ` Phil Pennock
1998-10-27 4:21 ` Bart Schaefer
1998-10-27 5:13 ` Zoltan Hidvegi
1998-10-28 4:53 ` Bart Schaefer
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=199810262303.XAA00552@athenaeum.demon.co.uk \
--to=phil@athenaeum.demon.co.uk \
--cc=zsh-workers@math.gatech.edu \
/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).