I see. Thanks for the explanation.
So the following works:
-------------------------------
\unprotect
\setvalue{startNotes}%
{\global\settrue\c_page_comment_enabled
\grabbufferdatadirect{pagecomment}{startpagecomment}{stopNotes}}
\protect
\def\stopNotes{}
------------------------------
What does the second argument to \grabbufferdatadirect mean? Nothing changes when I modify that.
The point of redefining the pagecomment environment for me was to style it a bit: add \righttoleft at the beginning, and surround the content in startstopnarrower. How can I inject prepend/append to a buffer's content?
The solution I can think of is to use a different buffer "pagecomment_internal" in the above definition, and then build buffer "pagecomment" using that.
Thanks,
~MHB