docs: def append(self, mode):
          """
          Adds a mode to the editor.
  
          :param mode: The mode instance to append.
  
          """
          _logger().log(5, 'adding mode %r', mode.name)
          self._modes[mode.name] = mode
          mode.on_install(self.editor)
          return mode