IT IS a measure of how much public discourse has changed that the argument this week on gay rights was about how rude politicians can be not to homosexuals, but to their opponents. Nick Clegg’s office caused the row by releasing to journalists an excerpt from a forthcoming speech by the deputy prime minister which described those who want the legalisation of gay marriage postponed as “bigots”. Amid squawks from the right, Mr Clegg said he would never use such a word, but he did not repudiate the sentiment; nor was there any comfort for the (mostly) Christian objectors to this considerable step towards equal rights for gays from the Conservative senior partner in the coalition government. Which, given that only 24 years ago Section 28 of the Tories’ Local Government Act banned councils from allowing schools to promote “the acceptability of homosexuality as a pretended family relationship”, is quite a step.

Close analysis of the Tories’ loss of the 2005 election by Lord Ashcroft, former deputy chairman of the party, is in part responsible for this change. The party, his polling showed, was regarded as “old-fashioned”. “Voters sensed,” says a strategist, “that it had an obsession with old taboos, and a contempt for new ones.” It regarded homosexuality, in other words, as reprehensible, and homophobia as fine; it viewed ethnic minorities as alien, and racism as natural. Such attitudes turned off not just those particular groups, but also better-off and better-educated voters.

David Cameron set about modernising the party with the sure touch of a man doing not just what he knows is expedient but also what he believes is right. “I don’t support gay marriage in spite of being a Conservative,” he told the party conference last year. “I support gay marriage because I’m a Conservative.” He has promoted openly gay ministers and apologised for Section 28. The Tories have more openly gay MPs than any other party, and the Scottish Conservatives are led by a lesbian. Mr Cameron hosts an annual “Gay Night”. And he has initiated substantive changes—legislation to wipe clean the records of people convicted for homosexual offences that were subsequently legalised, and to allow gay marriage.

Deficit reduction is a doddle compared with persuading some in the party to suppress their instinctive horror. The prime minister has conceded that the parliamentary vote on gay marriage should be a free one—recalcitrant Tory MPs will not, in other words, have their arms twisted by party whips. Some gays fear that the recent cabinet reshuffle—Chris Grayling, who once supported the right of bed-and-breakfast-owners to turn away gay couples, was promoted to justice secretary—shows a weakening of the government’s commitment. But despite the lengthening list of U-turns, Mr Cameron seems unlikely to abandon a commitment so central to his reshaping of British conservatism.

Whether the effort is paying off is not entirely clear. Recent polling by Lord Ashcroft suggests a fairly even balance between those who would be encouraged to vote Tory if the party introduced same-sex marriage and those who would be discouraged from doing so. In a poll carried out by YouGov for Stonewall, a gay rights organisation, whereas 37% of voters regarded Labour as gay-friendly, the figure for the Tories was only 22%.

Still, in the heyday of Section 28, the Tories’ score would probably have been closer to zero. They get plaudits from gay rights organisations. And in The Yard, a gay bar in Soho, most drinkers think the Tories are moving in the right direction. One explains that he was brought up Labour, but “I’ll always vote Tory now…I’m impressed by what they have done. The colonels and the ladies with purple hair in the constituencies must hate it, and they still have a lot of power, but they’ve been overruled.”

If the Tories could replicate among ethnic minorities the progress they have made among gays, they would win a big electoral prize. Only 16% of Asians, black Caribbeans and black Africans voted Tory in the last election, compared with 37% of white people. The reasons are complex. Ethnic minorities feel grateful to Labour for passing all the main equality laws; Enoch Powell’s “Rivers of Blood” speech (1968), in which he warned of the conflict that would result from immigration and Norman Tebbit’s “cricket test” (1990), in which he cast aspersions on the loyalty of those who failed to support the English cricket team.

No such thing as a minority vote

The Tories’ modernisation agenda could itself make their task harder. Social attitudes among ethnic minorities are frequently old-fashioned. Pakistanis, Bangladeshis and Africans are distinctly less liberal on homosexuality than are Indians, Afro-Caribbeans or white Britons. But in other ways, ethnic minorities are natural allies of today’s Tory party. They are upwardly mobile, keener on cutting taxes than on raising government spending, and more concerned about law and order.

So Tory modernisers think Mr Cameron should repeat the moves that have won partial success with gays. He made a start in the reshuffle, by promoting ethnic-minority MPs—including his new parliamentary private secretary, Sam Gyimah. He could repudiate the “cricket test”, rather as he apologised for Section 28. As for a substantive policy comparable to gay marriage, the issue that divides ethnic-minority people most clearly from the rest of the electorate is workplace discrimination. White people don’t think it happens, black and brown people do. Since there is plenty of evidence that black and brown people are right, the Tories should spend a little time thinking how, without tying business up in red tape, they might change behaviour. A name-and-shame policy, perhaps, for the businesses who regularly lose discrimination cases. If the Tories get the message right, they could make a lot more friends.

Economist.com/blogs/bagehot