France may have taken the world by surprise Thursday, July 6, when it declared plans to end the sale of petrol and diesel cars by 2040, but its auto-manufacturers have long seen the writing on the wall.

Group PSA (PUGOY) , maker of Peugeot and Citroen cars, had already announced that 80% of its existing models will have an electric version by 2023 and plans to release between five and seven new electric vehicle models within the next four years.

Renault SA (RNSDF) , maker of France's and Europe's most popular electric car the Zoe - with over 70% and 14.7% of the market respectively, has invested heavily to nearly double the car's range. The new model can run for 400 kilometers (248 miles) up from 240 km.

The Zoe, which is priced at about €24,000 ($27,000) outsold its closest European rival, Nissan's Leaf, by almost two to one in the first quarter of 2017.

Investors were sanguine about the government's plan. Renault shares traded Friday at €80.70, unchanged since Thursday. Peugeot stock was at €18.24, up from its Thursday open of €17.89. 

It isn't only French carmakers that are making the leap to electric motors. Volvo, the Swedish car maker now under Chinese ownership, on Wednesday announced all its models would be either electric or hybrid from 2019.   

It is a "revolution" but "the conditions are in place," declared France's minister for ecological transition Nicolas Hulot as he announced France's plan to end fossil fueled car sales. "Our own constructors have in their tool kits the means to feed and realize this promise."

France's electric vehicle target - it remains to be seen what legislation will back the goal - is part of a wider effort by new President Emmanuel Macron to push French industry to embrace the possibility of the low carbon economy.

Also on Thursday, France declared it would stop issuing new gas and oil exploration permits - signing the death warrant for the already slim hopes of a French fracking boom.

Macron has also announced plans to spend €15 billion over five years on green transition technologies. Earlier this week his government outlined plans to offload state-owned stakes in listed companies to fund a €10 billion incubator fund focused on tech and particularly green-tech startups.

In the wake of President Donald Trump's decision to pull the U.S. out of the Paris Climate Change deal the French president spoke directly, and in English, to U.S. citizens telling "all scientists, engineers and entrepreneurs ... who were disappointed by the decision of the United States ... that they will find in France a second home land. Come and work here with us."

There is hard commercial and economic sense behind France's new-found love of tree hugging. Last month Goldman Sachs predicted about €3 trillion of investment in European renewable energy over the next 20 years as renewable power becomes cheaper than its fossil fueled alternative.

Bloomberg New Energy Finance, an industry research group, tipped electric vehicles (EVs) to account for 54% of new car sales by 2040, even without government intervention, as electric vehicles become cheaper than their combustion engine (ICE) rivals by mid-2020.

"The real take-off for EVs will happen from the second half of the 2020s when, first, electric cars become cheaper to own on a lifetime-cost basis than ICE models; and, second - arguably an even more important moment psychologically for buyers - when their upfront costs fall below those of conventional vehicles," according to research released on July 6.