def METHOD_NAME(self):
    """Internal clear_undo function. Emit 'undo-changed' if the undo stack
    previously had items."""
    has_history = len(self._undo) > 0
    self._undo.clear()
    if has_history:
        self.emit('undo-changed', False)