Index: class.c ================================================================== --- class.c +++ class.c @@ -1056,11 +1056,16 @@ if(tokent==TF_INT) { if(!macstack) ParseError("Empty macro stack\n"); n=tokenv-1; nxttok(); if(n<0 || macstack->n<=n || !macstack->args[n]) ParseError("Cannot edit nonexistent argument %u\n",n+1); - if(macstack->args[n]->t&(TF_MACRO|TF_EOF)) ParseError("Invalid edit token\n"); + if(macstack->args[n]->t&TF_OPEN) { + free_macro(macstack->args[n]->next); + macstack->args[n]->next=0; + } else if(macstack->args[n]->t&TF_EOF) { + ParseError("Invalid edit token\n"); + } free(macstack->args[n]->str); macstack->args[n]->t=tokent; macstack->args[n]->v=tokenv; macstack->args[n]->str=0; if(*tokenstr) { Index: class.doc ================================================================== --- class.doc +++ class.doc @@ -185,12 +185,13 @@ {edit } Edit a macro. This changes the first token of the definition of the macro (which must not be another macro) to the specified token. The token is expanded, and must be a single token once it is expanded; that is what it will be replaced with. There is a variant with a number in place of a - string; this will replace the argument of the macro which is currently - being expanded. + string; this will replace the first token of the argument of the macro + which is currently being expanded (or the entire token if it starts with + an opening delimiter). {include } Include text from another file into this one. You cannot use {include} inside of another macro or in a macro argument. The file must be in the current directory, and its name must contain only letters, digits, dot,