IT was “money and ethnic votes”. It is nearly 27 years since Jacques Parizeau said the words that would come to define him and, for some, his cause.

The Quebec premier had just seen his dream of independence from Canada dashed, by the slimmest of margins.

Exhausted, the sovereigntist had found somebody to blame for his defeat in the 1995 referendum: migrants.

He was speaking at a rally just as the result was becoming clear. There had been defiant chants of “Oui, Oui, Oui” until he mentioned those ‘ethnic votes’. Then came the boos and whistles. It was not pretty.

Even now Parizeau’s aside haunts the Quebec sovereignty movement. It also, I think, hangs over Scotland’s more than we suspect. Why? Because senior SNP figures saw how even a hint of xenophobia would damage their cause, perhaps fatally.

READ MORE: Putin and a surprising Scots echo

Ask clued-up pro-independence leaders here about Parizeau and their noses wrinkle. The SNP has spent recent decades trying to distance themselves from anything that could be portrayed as anglophobic blood-and soil-nationalism (though even a quick scroll through social media suggests they have been far from always successful.)

For years the party has been vocally, inclusively and – a cynic might add – performatively pro-immigration.

This, and its opposition to Brexit, had paid some political dividends for the SNP. Earlier this month the authoritative Scottish Election Study revealed the party in 2021 took a plurality of votes from those born outside the UK. (It did far, far worse among “new Scots” from England).

The news of ‘foreigner’ support of independence and the SNP has not go down well on the more British nationalist fringe of online unionism. There were outbursts from some of the more excitable pro-UK accounts, mostly – but far from all – anonymous.

Initially the focus was on a single SNP staffer, a Pole of Jewish heritage called Olaf Stando who moved to Scotland as a child. He was called a traitor, a Nazi, and told he should be deported to Rwanda.

Jon Stanley, the leader of the Scottish Unionists, a recently re-registered micro-party, also got on his case. “We rightly call these fifth columnists, those in our country, not with our citizenship, who want to end our country,” Mr Stanley, a surgeon, tweeted about Mr Stando.

READ MORE: The Gael-phobic fringe

It got worse. Elsewhere, there were whole conspiracy theories about the SNP handing out votes to displaced Ukrainians, according to one troll, “like sweeties”.

This patter was, bluntly, detached from reality. Hardly anyone fleeing Putin’s invasion would have voted earlier this month. There is no way of knowing how those few Ukrainians who did get to the polls would have cast their ballot other than, perhaps, pointing out how genuinely popular Boris Johnson is in their homeland.

Twitter politics, of course, is as stupid as it is ugly. And I really do not want to make readers wade any deeper in to this particular cesspit. But I do think it is worth stopping and asking ourselves what is happening here.

It is easy to dismiss this latest episode as nothing more than the venting of very online types, many of whom also routinely abuse indigenous linguistic minorities. But there is more to it than that.

Scotland has xenophobes. This country’s progressives may not like to admit it, but we have a largely untapped market for anti-foreigner rhetoric.

Survey after survey has shown Scottish and English attitudes to immigration are almost identical.

Back in late 2018, John Curtice and Ian Montagu of Strathclyde University dug in to data from both the British and Scottish Social Attitudes Studies.

Let us take one measure, the percentage of people who think immigration has been “bad” for culture. It was 20% in Scotland and 23% in England and Wales. That is a lot of people, on both sides of the border.

But there are nuances here. In Scotland, anti-immigration sentiment is higher among the older, the less educated and, crucially, the more unionist.

For SNP voters, net approval for the contention that immigration has been culturally beneficial ran at plus 42 per cent. Among Scottish Conservatives, it was minus one.

Mainstream Tories north of the border – to their great credit – have not particularly pandered to the anti-immigration views found in their base. But that leaves a gap for others to exploit, for social media attention, for crowdfunding, for monetisable clicks and, ultimately, for votes.

I doubt pro-UK online warriors have been poring over polling spread sheets. But they can see the likes rack up for foreign-bashing posts just like the rest of us.

So there is, I am afraid, a gruesome political and potentially even commercial logic for those British nationalists haranguing Polish-born SNP staffers or Ukrainian refugees online.

But what is good for this fringe is not what is best for old school mainstream unionism.

Ultimately alienating a large chunk of voters - the foreign-born and their friends and family as well as the wider pro-immigration majority — could prove electorally fatal for the UK.

Mark McGeoghegan, a pollster turned post-graduate researcher at Glasgow University, stressed how hard it was to discuss these issues in Scotland’s hyper-partisan political culture.

He said: “We cannot have an open or honest debate on xenophobia – whether against the English or people from further afield – because the issue has been weaponised.”

It could get nastier still. Will we now see a campaign to disenfranchise non-citizens?

Mr McGeoghegan reckons that, with polling on independence still very close, unionists cannot afford to offend hundreds of thousands of voters with overseas links. If they do, a future pro-UK leader may end up doing a Parizeau and blame the end of Britain on “ethnic votes”.

Our columns are a platform for writers to express their opinions. They do not necessarily represent the views of The Herald.