'Attempt to perform completion on the text before point. The
actual completion performed is application-specific. The default is
filename completion.'

def complete(self, e):

    completions = self._get_completions()
    if completions:
        cprefix = commonprefix(completions)
        rep = [c for c in cprefix]
        point = self.l_buffer.point
        self.l_buffer[self.begidx:self.endidx] = rep
        self.l_buffer.point = ((point + len(rep)) - (self.endidx - self.begidx))
        if (len(completions) > 1):
            if (self.show_all_if_ambiguous == 'on'):
                self._display_completions(completions)
            else:
                self._bell()
    else:
        self._bell()
