docs: def commit(self):
          """
          Delete the rest of the line.
          """
  
          # Get the text cursor for the current document and unselect everything.
          tc = self.qteWidget.textCursor()
          tc.clearSelection()
  
          # If this is the first ever call to this undo/redo element then
          # backup the current cursor position and the selected text (may be
          # none). This information will be required for the redo operation
          # to position the cursor (and selected text) where it was at the
          # very first call.
          if self.cursorPos0 is None:
              self.cursorPos0 = tc.position()
  
          # Ensure nothing is selected.
          tc.setPosition(self.cursorPos0, QtGui.QTextCursor.MoveAnchor)
  
          # Mark the rest of the line, store its content in this very object
          # and the global kill-list, and remove it.
          tc.movePosition(QtGui.QTextCursor.EndOfLine,
                          QtGui.QTextCursor.KeepAnchor)
          self.cursorPos1 = tc.selectionEnd()
          self.killedText = tc.selection().toHtml()
          data = qtmacs.kill_list.KillListElement(
              tc.selection().toPlainText(),
              tc.selection().toHtml(),
              'QtmacsTextEdit-Html')
          qte_global.kill_list.append(data)
          tc.removeSelectedText()
  
          # Apply the changes.
          self.qteWidget.setTextCursor(tc)