macros: fix scope of macro hook call

(integrated from trunk branch change c407dc6 by Todd Whiteman <toddw@activestate.com>)