It's ALWAYS the Pope attacking me :) Its when I end the siege (if the Pope loses the battle, there is no excommunication - only if he wins and you respond) that I get the warning. However, in this most recent case, I was at war with the papacy when my leader died and I didn't attack that year but noticed my leaders had broken crosses. I'm inclined to believe that if you are already at war with the Pope when your King (actually, Emperor in this case) dies that the excommunication carries over as someone before had thought possible.