def METHOD_NAME(self, label: str = None, changed: bool = True, setLabel: bool = True) -> None:
    """
    Do the common processing at the end of each command.
    Handles undo only if we are in the body pane.
    """
    k, p, u = self.c.k, self.c.p, self.c.undoer
    w = self.editWidget(event=None)
    bunch = self.undoData
    if bunch and bunch.name.startswith('body') and changed:
        newText = w.getAllText()
        if bunch.undoType.capitalize() == 'Typing':
            u.doTyping(p, 'Typing',
                oldText=bunch.oldText,
                newText=newText,
                oldSel=bunch.oldSel)
        else:
            p.v.b = newText  # p.b would cause a redraw.
            u.afterChangeBody(p, bunch.undoType, bunch.undoer_bunch)
    self.undoData = None
    k.clearState()
    # Warning: basic editing commands **must not** set the label.
    if setLabel:
        if label:
            k.setLabelGrey(label)  # pragma: no cover
        else:
            k.resetLabel()