HEAVEN knows why I was daft enough to get involved in a Twitter "spat", as the press called it, with JK Rowling about anti-English racism in the SNP.

It's a bit like having an argument with Mother Teresa, so high is the moral authority of the Harry Potter author.

JK Rowling is a philanthropist, a social democrat and very humane and intelligent woman, as I know from my time as Rector of Edinburgh University, which benefited from her largesse. She has also been subject to personal abuse on social media.

Ms Rowling is a figure of enormous influence, not just in Scotland but in the rest of the world. She need merely fire off a tweet for it to be instantly front-page news as: "JK Rowling: there is still anti-English prejudice in the SNP." Social media is now is now often leading the news rather than following it.

I am not and never have been a member of the SNP, and it should be up to them to defend their reputation as a party that has zero tolerance of anti-English prejudice. But sometimes these things just happen. It was more my sense of history that was offended.

Anyone who knows anything about the SNP knows that stamping out anti-English sentiment has been a top priority for its party leaders since the 1960s. Scottish Nationalists have form here. The Nationalist poet, Hugh MacDiarmid, used to put "Anglophobia" as his hobby in Who's Who.

There is an assumption, which is almost unchallengeable among large sections of the media and the left, mainly in London but also in Scotland, that the SNP is by definition an anti-English party. Many of the hundreds of people who piled into the Twitter "storm" claimed exactly that.

My column that launched this extraordinary episode was, ironically, about the rise of the far right in Denmark and the Nordic countries. On Thursday, the anti-immigration Danish People's Party exceeded its own expectations by coming second in the general election there. The far right is still a minority in Finland and Norway but they have been participating in both countries in centre-right coalitions.

Fear of immigration is rising all over Europe, as right-wing political leaders (led it has to be said by David Cameron) refuse to share the burden of Mediterranean boat people. Fear of Islamic terrorism is leading to a reaction against multiculturalism. There is a growing feeling in the small Nordic countries that Muslim communities do not integrate.

This is a toxic brew. I argued that the lesson for Scotland is that "being a small nation does not immunise a society from the politics of the right". I went on to point out that "intense love of country ... can easily turn into hatred of foreigners".

However, if you make remarks about the rise of the nationalist right in Denmark, Finland and Norway you are under an absolute obligation to point out that the Scottish National Party has been uncompromising in its rejection of racism including anti-English racism and prejudice.

But before I go on, let me repeat the section that JK objected to: "We know from opinion polls that there are a lot of Scots who would like to see immigration curbed even though this hasn't been a decisive issue in Scottish elections. There are corners of Scottish society where it is still acceptable to be prejudiced against people of a different colour or religion.

"However, to turn latent unease into full-scale grievance you need to have parties willing to exploit fear and prejudice for political ends. In Scotland, for historical reasons, the SNP is, unlike nationalist parties in the North of Europe, a civic nationalist pro-immigrant party.

"Any trace of ethnic nationalism, and anti-English sentiment, was expunged from the party in the 1970s. Nicola Sturgeon was the only party leader in Britain who, during the General Election debates, consistently and energetically argued that immigrants benefit society."

JK Rowling questioned this. "Quite a claim," she wrote. "How many English incomers were polled before the making of that confident assertion?" I pointed out that since the SNP expelled the militant "Seed of the Gael" organisation in the 1970s, there has been "zero tolerance of anti-English racism".

I asked JK: "When did you last hear of anyone of any significance in the SNP expressing anti-English racism?" She replied: "Gordon Wilson ex-leader of the SNP who talked of attacking the English southern cancer. Nice Language. Very civic."

Gordon Wilson is today a marginal figure in the SNP but even he never talked of an "English cancer". He was referring to London and the south-east. Not very nice, perhaps, but like Alex Salmond's "dark star" remark about the economic dominance of London, hardly a racial slur on the English as such.

She also cited a remark from the former deputy leader, Jim Sillars., from 2010. "England will put its state interests first, is a truth too many Scots are not willing to face."

Now, saying a country puts its state interests first does not appear to me to be an expression of anti-English prejudice. It is not a racial slur. But if anyone does think this is anti-English, well, that is up to them. I'm not going to repeat all of the Twitter exchange here - it's all on the internet anyway so anyone interested can draw their own conclusions.

But surely we have to give credit to civic nationalist parties that refuse to dig into the dark side and seek to exploit fear and communal resentments. Now that politics is increasingly moving away from social class and towards the politics of nationhood, these tensions must be guarded against at all times.

There is racism and prejudice in small countries like Scotland and Denmark just as there is in big countries like France and England. There may be individuals in the SNP who hate the English, as there may be in any party. But the point is that this is simply not tolerated.

Also: all of us in public life have a responsibility not to misuse social media to traduce people whose view we disagree with. There are many angry people in Scotland. They have always been there, but now they can pour their bile onto the public domain with the click of a mouse.

Unscrupulous hacks recycle this dross and call it journalism. We mustn't let this overwhelm reasoned discussion. Since the General Election landslide, the media is on a hair trigger for signs of anti-Englishness in the SNP.

But there is one thing we can say without fear of contradiction. There is no party of the nationalist right which has had any significant presence in Scottish politics. There is no Danish People's Party in Holyrood, no True Finns. There is only Ukip, which scraped an MEP in 2013 - and whatever else it is, this is not an anti-English party.

I hold no animosity towards JK Rowling and I am sure her motives are entirely honourable. She has every right to express her views and to warn against anti-English prejudice taking root in Scotland. She has been a victim of unpleasant abuse herself. Equally, the Scottish National Party does not tolerate or justify anti-English racism, and it does a disservice to politics to suggest otherwise. Preventing latent prejudice becoming manifest requires eternal vigilance. Scottish politicians of all parties have been in my view uniquely responsible in not exploiting prejudice. Why not put that on the front page for a change?