Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

anonymous function question

Hi everyone,

I normally have interactive_comments set, but while doing some testing it got unset.
So now comments within an anonymous functions typed in at the command line, or
called back from history, outputs different errors depending on what is commented.
% ()
function> {
function> #echo interactivecomments test
function> }
Outputs:  (anon):2: bad pattern: #echo

Adding 'setopt interactive_comments' before the echo command within the anonymous
function has no effect.

Only setting interactive_comments external to the anonymous function stops an error
from occuring.

This seems to be different then what is expected in a non-anonymous function. May
have missed something, but do not see anything in the manual indicating this is the
case. If so sorry for the noise.

Is this normal for an anonymous function?
Why doesn't setting interactive_comments within an anonymous function work?

Thanks, and best regards,

Jim Murphy

Messages sorted by: Reverse Date, Date, Thread, Author