undo_menu_description
[0|1] = undo_menu_description(label[, doc])
This function assigns label as the menu label for the next undoable operation on document doc. If doc is not specified, the value of current_doc is used.
If this function is called multiple times during a single undoable operation, only the label from the first call is used. Subsequent calls are ignored. The function returns a one (1) if the label will be used, or zero (0) if the call is ignored. To clear a label set by a previous call, see the
undo_menu_description_clear function.
An example follows:
local undoMsg = undo_menu_description("Great Operation", doc);
...
local ret = great_operation_action(...);
# If the above failed so doc was not modified, then clear the
# undo label (if not, it will be applied to the next operation)
if ((! ret) && undoMsg) {
undo_menu_description_clear(doc);
}