The Tory party has been at peace with itself this week. Eurosceptic backbenchers have given Nigel Farage a verbal kicking on the fringe, Cabinet ministers have stuck resolutely to the ‘hard- working’ conference script, and even Boris Johnson has behaved himself. Gay marriage, which so divided the leadership from the grassroots, has barely been mentioned, and you’d never know that just a month ago David Cameron lost a Commons vote on Syria.

The new harmonious mood has come about in part because the leadership has moved towards the rest of the party. Tory conference was once decorated with posters extolling the benefits of ‘the big society’. Now, there is a simple Conservative message: ‘Welfare Capped: Immigration Down: Crime down’. Cameron’s own speech was a classically Tory defence of the need for enterprise and profit.

Lynton Crosby has also helped to bring the party together. He is a fierce disciplinarian who is both respected and feared: few wish to fall foul of his text-message temper. He is also close enough to Boris Johnson to ensure his good behaviour. When I asked a No. 10 source why the mayor had been so unusually helpful to Cameron at this conference, he replied, ‘It’s the Lynton effect.’

But the person doing the most to promote Tory unity is Ed Miliband. The Labour leader’s conference speech has reminded the Tory tribe of how high the stakes will be at the next election. The party has grasped that if Miliband becomes Prime Minister, he’ll unpick the Thatcherite consensus. A win for him would reverse many of the victories that the right in Britain holds most dear.

For the past three years, Conservatives have often talked as if the alternative to the current coalition is a radical, right-wing Tory government. Miliband has now delivered a reminder that, in reality, the alternative is a left-wing government. Suddenly, the com- promises that Cameron has made in coalition do not seem so bad.

Tory strategists talk of a ‘carrot and stick’ approach to dealing with the threat of Ukip on their right. The carrot is more robust Tory policies on welfare, immigration and human rights. The stick is the prospect of Ed Mili- band as Prime Minister.

Until this conference season, Miliband was ridiculed more than he was feared. Now,though, those on the Eurosceptic right of the Tory party feel more confident attacking Ukip for easing Miliband’s way to Downing Street. It was telling that Nigel Farage’s visit to the conference fringe was not the triumphant affair that the Tory leadership had feared. Instead, Farage was harangued by Bill Cash for ‘not acting in the national interest’ and for making it less likely that there would be a referendum on Britain’s membership of the European Union.

When one cabinet minister was told about the barracking of Farage, he struggled to believe it. At first, he assumed the tar- get of the Eurosceptics’ ire had been Cameron, not Farage. When it finally dawned on him what had happened, he expressed great relief. He said he had been worried that the Ukip leader would emerged from Man- chester as the true leader of the Conservative Eurosceptics. Instead, by picking a fight with them, Farage has made life easier for Cameron.

But the Tory party will still have to fight on multiple fronts at the next election, protecting its right flank from Ukip while trying to win votes off Labour. The only consolation is that some policies appeal to both sets of voters. For instance, the new Tory plan to make the long-term unemployed work for their benefits will go down well with Ukip voters — according to Lord Ashcroft’s latest poll, 20 per cent of such voters in Labour- Tory marginals think that cutting welfare dependency is one of the top three issues facing the country. At the same time, the policy commands support from more than two-thirds of the public. It is no coincidence that it was the brainchild of Osborne’s new adviser Neil O’Brien, whose political mis- sion is to fashion a grittier Toryism that can win votes in the cities of the north.

This is one of the reasons why the Tory leadership is so desperate to avoid mention- ing Ukip by name. They want to avoid the perception that they have been forced into adopting these policies by the rise of Farage. As one of Cameron’s oldest friends in poli- tics says, ‘The perception we’re pandering to Ukip is so dangerous because it makes these promises look inauthentic.’

The Cameroons are also acutely aware that they have to show that they remain inter- ested in the whole gamut of political issues. This is why the announcement that money would be provided for doctors’ surgeries to stay open from 8 a.m. to 8 p.m. seven days a week has been given such prominence. The move is meant to show that Cameron and company still represent a new kind of Tory- ism, passionately committed to the health service.

Cameron has had an odd relationship with his party from the start. He won the leadership in 2005 on the transactional plat- form of ‘change to win’. The party never loved him, but believed that he could turn the political tide after three successive election defeats. When Cameron failed to deliver either a majority or the referendum on Europe he had seemed to promise, the relationship soured.

What Miliband has done by sharpening the political dividing lines is to excite both sides of the divide. He has energised the base of the Tory party in a way that Cameron in coalition has so far failed to do. But his own supporters on the newly reunited left of British politics are also more determined than ever. Given that Miliband could win in 2015 with only 35 per cent of the vote, that is no small consideration. The next election is already looking like a clear-cut ideological fight.

This is James Forsyth’s politics column from this week’s Spectator, available in print and online from tomorrow. Click here to subscribe.

Tags: David Cameron, Ed Miliband, Labour, Nigel Farage, party politics, Tory rebels, UKIP