From 7e0ca714695bf22171c1b937899ee42d6afde376 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 20 Jul 2009 09:02:39 +0000 Subject: 27178: FAQ---quoting function names to stop expansion is always safe --- ChangeLog | 7 ++++++- Etc/FAQ.yo | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ec31a691a..eaab74d22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-20 Peter Stephenson + + * 27178: Etc/FAQ.yo: as pointed out by Mikael, quoting + function names to stop alias expansion is always safe. + 2009-07-19 Barton E. Schaefer * 27169: Src/jobs.c, Src/signals.c: 23067 went too far in opening @@ -12018,5 +12023,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.4746 $ +* $Revision: 1.4747 $ ***************************************************** diff --git a/Etc/FAQ.yo b/Etc/FAQ.yo index 518f7aae8..a83dc252f 100644 --- a/Etc/FAQ.yo +++ b/Etc/FAQ.yo @@ -819,6 +819,14 @@ label(23) use in the body of a function, but define the function first if the alias has the same name as the function. + If you aware of the problem, you can always escape part or all of the + name of the function: + verb( + 'l'() { /bin/ls -la "$@" | more } + ) + Adding the quotes has no effect on the function definition, but + suppresses alias expansion for the function name. Hence this is + guaranteed to be safe. sect(Similarities with tcsh) -- cgit 1.4.1