He was prime minister of France from 1976 through 1981 , and also held the posts of vice president of the European Union , French economics minister and mayor of Lyon .