Re: [PATCH] Support a stack of LINENO values for AS_MESSAGE.

2008-10-16 Thread Paolo Bonzini
[snipped totally correct reasoning] So, for potential efficiency purposes, should we rewrite this line to use: as_lineno_stack=$as_lineno_stack=as_lineno_stack Actually as_lineno_stack=${as_lineno_stack}as_lineno_stack= or maybe even write AS_APPEND([var],[text]), which expands to a shell

Re: [PATCH] Support a stack of LINENO values for AS_MESSAGE.

2008-10-15 Thread Eric Blake
Paolo Bonzini bonzini at gnu.org writes: 2008-10-14 Paolo Bonzini bonzini at gnu.org * lib/m4sugar/m4sh.m4 (_AS_ECHO_LOG): If defined, use $as_lineno as the line number emitted to the log file. (AS_LINENO_PUSH, AS_LINENO_POP): New. Now that this is already applied...

[PATCH] Support a stack of LINENO values for AS_MESSAGE.

2008-10-14 Thread Paolo Bonzini
Ok, so here is what I concocted to get correct line numbers in shell functions. The idea is that the line number of the outermost invocation wins. In C-like syntax, that would be just if (++depth == 1) as_lineno=SOMETHING ... if (--depth == 0) unset as_lineno but we have to find

Re: [PATCH] Support a stack of LINENO values for AS_MESSAGE.

2008-10-14 Thread Eric Blake
Paolo Bonzini bonzini at gnu.org writes: 2008-10-14 Paolo Bonzini bonzini at gnu.org * lib/m4sugar/m4sh.m4 (_AS_ECHO_LOG): If defined, use $as_lineno as the line number emitted to the log file. (AS_LINENO_PUSH, AS_LINENO_POP): New. * tests/m4sh.at (LINENO Stack):