GLANCING out of his office window on April 8th, the day Margaret Thatcher died, Bagehot noted the union flag at half-mast over the Palace of Westminster. On his way home, he passed a herd of paparazzi jostling for the first coffin shot outside the Ritz hotel, where she suffered her fatal stroke. Arriving in Brixton, centre of the 1981 race riots that were one of the defining images of her premiership, he skirted a crowd drinking fizzy wine and chanting offensive slogans about a politician who had left power almost a quarter of a century ago (before a few of the revellers were even born). All London, a city transformed in that intervening time, seemed fixated on her death.

Yet it is in Mrs Thatcher’s Conservative Party that the venting is most intense. Most Tory MPs issued encomiums to a great modern leader—the first to win three elections on the trot, the first woman at that. Many younger ones described her as their inspiration, the reason they had entered politics. But amid the ululation there was discord, too: indications of how troublesome Mrs Thatcher’s legacy is to a party that has won only one thin majority since she was bounced from power in 1990.

Invited to give the last word on a leader who rarely conceded it in debate, some of her Tory colleagues were pointedly restrained. “I am sorry to learn of Lady Thatcher’s death,” said Lord Heseltine, her most formidable rival. “The illness of her last years has been cruel and very difficult.” On the right of the party, self-proclaimed “Thatcherites” saw in her death an opportunity for point-scoring. “The Iron Lady was brought down by a collection of euro-fanatical MPs,” wrote Daniel Hannan, a Europhobic Tory MEP. In a thoughtful tribute, George Osborne, the chancellor of the exchequer, suggested how imposing her titanic shadow is for more moderate Tories. She was great, he wrote; yet her legacy “risks being overpowering for the two generations of politicians who have come after her, including my own.”

Ever since her political demise, Mrs Thatcher’s shade has haunted the Tory party. Under John Major, her immediate successor, who had most of her views but not her authority, party order broke down, chiefly over the Euroscepticism that she, disloyally, helped stir from the wings. A party that owed its success to a reputation for toughness and discipline came to seem chaotic and quixotic. Its vote base withered to the affluent south, main beneficiary of her revolution. So it was Labour, under Tony Blair, who had ingested her liberal economic policies, that became her true inheritor. In winning three successive elections, it pushed the Tories, like a fugitive army, far to the right, where they fumbled for whatever electoral elixir they fancied Mrs Thatcher had possessed. Under William Hague, Iain Duncan Smith, then Michael Howard, a party that had ruled Britain from the centre harboured Euroscepticism, xenophobia, a wide-eyed Atlanticism and instinctive distrust of regulation of any kind. Thatcherism, a term whose original meaning—chiefly a belief in the superiority of private enterprise over public ownership—is now orthodoxy, has instead come to denote these extremities.

This was electoral madness. It also misrepresented Mrs Thatcher, who was more pragmatic than many of her latter-day acolytes allow, at least in her triumphant first and second terms. Far from inflexible—the never-turning, never-wavering leader of their dreams—she picked her battles carefully, refusing any she felt unable to win. Not until the power stations were well-stocked with coal did she contemplate taking on the miners. She never took on the destructive teachers’ unions. “She understood that politics is always two steps forwards, one step back,” says Ken Clarke, a minister in all her governments. She was a scientist, too, and with that came a respect for empirical truth: as illustrated by her pioneering acceptance of global warming, in which some modern-day Thatcherites do not believe. Their selective, distilled Thatcherite creed has not just overpowered the modern Tory Party, but almost wrecked it.

Exorcising Maggie

David Cameron, the party’s leader since 2005, has sought to restore sanity. He instructed the Tories to stop “banging on about Europe” and gave them new causes. Some, such as environmentalism and volunteerism, Mrs Thatcher would have liked; others, including gay marriage, she would not. He also distanced himself, just a little, from his by then ailing predecessor. Yet Mr Cameron received only grudging support from his party for this reorientation, and having failed to win an electoral majority in 2010 he has come under pressure from the right to abandon it. Sometimes he has buckled. As Mrs Thatcher died, he was in Spain trying to sell his vision of a looser European Union—a battle she would have approved of, even if it may be unwinnable.

In the venting over her death, including a parliamentary session called to honour Mrs Thatcher on April 10th, Mr Cameron is now under renewed pressure to tack right, as her cultish followers trust Maggie would have done. He must resist them. His diagnosis that he can lead the Tories to victory only from the centre is correct; nor will he be free of his predecessor’s shadow until he does. Thatcherites will never warm to Mr Cameron, however he may pander to them, unless he becomes a winner, as Mrs Thatcher was—and he will not win by their prescriptions.

Britain’s dire problems today are not those of the 1980s. The country’s economic travails are more global in nature; one of its most pressing imperatives, to trim state spending, was less urgent in Mrs Thatcher’s day. Second-guessing how she, a deceased politician from another age, might have dealt with these troubles is a fool’s game. Yet Mr Cameron can learn much from her. Having decided what was necessary, Mrs Thatcher made the case for her policies, executed them, and let voters judge her. For Mr Cameron, a leader with admirable instincts but too little fixity of purpose, every part of that process remains incomplete.

Economist.com/blogs/bagehot