Am 07.12.2012 um 10:26 schrieb Marco Patzer <homerow@lavabit.com>:

On 2012–12–07 Wolfgang Schuster wrote:

The argument for the command keys has to be a macro with two parameters,
the first parameters contains the formatted header and the second argument
the formatted content of the environment.

That's how I used it in the past, but after an update I got an error
which vanished after I removed the two arguments. I thought the
interface might have changed.

I used it as follows. What's wrong with that?

%% macros=mkvi
\usemodule [annotation]

\defineannotation
 [myannotation]
 [alternative=command,
  command=\cmd]

\starttexdefinition cmd #first #second
 \placeannotationcontent
\stoptexdefinition

Commands need to be unexpandable because when you use the “command”.

This is necessary because I check for a command and this needs \unexpanded\def to work.

You can create a unexpandable command with \starttexdefintion by adding
the unexpanded keyword as first argument to the environment.

\starttexdefinition unexpanded cmd #first #second
 \placeannotationcontent
\stoptexdefinition

Wolfgang