mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-03 10:21:46 +02:00
25641: add emulation option (NO_)MULTI_FUNC_DEF
This commit is contained in:
parent
f95570c403
commit
8bb15c1392
5 changed files with 18 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2008-09-11 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 25641: add option (NO_)MULTI_FUNC_DEF to turn off "foo1
|
||||
foo2...()" function definitions.
|
||||
|
||||
2008-09-10 Clint Adams <clint@zsh.org>
|
||||
|
||||
* Frank Terbeck: 25640: Completion/Unix/Command/_git: another alias
|
||||
|
|
|
@ -1133,6 +1133,14 @@ fn+LPAR()RPAR() { setopt localtraps; trap '' INT; sleep 3; })
|
|||
|
||||
will restore normally handling of tt(SIGINT) after the function exits.
|
||||
)
|
||||
pindex(MULTI_FUNC_DEF)
|
||||
item(tt(MULTI_FUNC_DEF) <Z>)(
|
||||
Allow definitions of multiple functions at once in the form `tt(fn1
|
||||
fn2)var(...)tt(LPAR()RPAR())'; if the option is not set, this causes
|
||||
a parse error. Definition of multiple functions with the tt(function)
|
||||
keyword is always allowed. Multiple function definitions are not often
|
||||
used and can cause obscure errors.
|
||||
)
|
||||
pindex(MULTIOS)
|
||||
item(tt(MULTIOS) <Z>)(
|
||||
Perform implicit bf(tee)s or bf(cat)s when multiple
|
||||
|
|
|
@ -181,6 +181,7 @@ static struct optname optns[] = {
|
|||
0
|
||||
#endif
|
||||
}, MULTIBYTE},
|
||||
{{NULL, "multifuncdef", OPT_EMULATE|OPT_ZSH}, MULTIFUNCDEF},
|
||||
{{NULL, "multios", OPT_EMULATE|OPT_ZSH}, MULTIOS},
|
||||
{{NULL, "nomatch", OPT_EMULATE|OPT_NONBOURNE},NOMATCH},
|
||||
{{NULL, "notify", OPT_ZSH}, NOTIFY},
|
||||
|
|
|
@ -1663,6 +1663,9 @@ par_simple(int *complex, int nr)
|
|||
zlong oldlineno = lineno;
|
||||
int onp, so, oecssub = ecssub;
|
||||
|
||||
if (!isset(MULTIFUNCDEF) && argc > 1)
|
||||
YYERROR(oecused);
|
||||
|
||||
*complex = c;
|
||||
lineno = 0;
|
||||
incmdpos = 1;
|
||||
|
|
|
@ -1882,6 +1882,7 @@ enum {
|
|||
MENUCOMPLETE,
|
||||
MONITOR,
|
||||
MULTIBYTE,
|
||||
MULTIFUNCDEF,
|
||||
MULTIOS,
|
||||
NOMATCH,
|
||||
NOTIFY,
|
||||
|
|
Loading…
Reference in a new issue