Coronal mass ejections and emerging flux