IT came out during a long radio interview with Sally Magnusson last year. I was asked among other things about Brexit and its implications for Scotland. Probably more in hope than in any expectation, I blurted out that Brexit would probably not happen. The prediction easily slipped off the tongue because I believe the Leave vote of June 2016 is an act of political and economic self-harm without equal in the modern history of the United Kingdom. Indeed, deciding to leave the biggest single trade bloc in the world as the result of a narrow majority in a referendum has to be seen as a collective act of potential economic suicide.

Against that background, it was indeed tempting to indulge in some wishful thinking. Even at that time, however, there were some reasons to be more positive than wholly negative. As the nightmare drew ever closer there might be a chance that the English, because it was they who produced the decisive majority for Leave, might yet come to their senses. After all, the majority was relatively close for such a momentous decision which will impact on the future of the country for generations to come. Also, the many fables, lies and false promises of the Brexiteer politicians and their lackeys in the right-wing press during the campaign were now exposed for all to see. Real fears were being expressed in Northern Ireland about Brexit and the problems it might cause for the border with the Republic.

The Scottish Government, smarting at the arrogant dismissal of its own proposals on Europe by Westminster, was sabre-rattling and threatening another referendum on independence. It also became abundantly clear that UK negotiators with the EU were likely to face an Amazonian forest of legal complexities as some well-informed voices predicted discussions could last for a decade or more. Remainers were to be found in most Westminster parties, even in the ranks of the Tories, so a tiny hope lingered that they might collectively be able to bring some pressure to bear on an adamantine and obdurate government.

Alas, such fragile hopes were quickly dashed. The 52 per cent of the electorate who voted Leave were enthusiastically embraced by Downing Street while the 48 per cent who voted Remain were ignored and left to mope in the wilderness of lost causes. A Prime Minister, who herself had argued for Remain, metamorphosed before our eyes into a vociferous cheerleader for leaving both the single market and the customs union. If that happened, the potential economic harm inflicted on the country might be increased ten-fold.

For fear of alienating working-class voters who might still be seduced by Ukip in the north and midlands of England, the Labour Party endlessly prevaricated and then found itself drowning in a sea of ambiguity over the issue. Only the SNP stayed constant in their opposition, but that was probably one reason among several others why the nationalists later lost seats at the General Election of June 2017.

Predictably, the usual suspects, aka the Daily Mail, Daily Telegraph, Express and Sun, lacerated everyone who had the temerity to speak out against the Brexit vote. Not only were they denounced as "anti-democratic", but some were also arraigned in the public dock as traitors to their country.

Gradually, too, the rest of the media, whatever their own inclinations on the subject, became reconciled to the inevitability of separation. The narrative now fixated on the kind of Brexit, "hard" or "soft", it might be, rather on whether the UK would indeed leave the EU. That vital question seemed to be fading into history.

And then came the General Election, followed by ironies of historical ironies, when the results were declared before an astonished nation. An election designed primarily to destroy the Labour Party, so that it would never again recover, and, as a secondary motivation, build a commanding majority for the Prime Minister to strengthen her negotiating hand with Brussels for a "hard" Brexit, ended for her in ignominy and personal humiliation.

The people had indeed spoken. It was almost the exact opposite of what Teresa May's coterie of unpleasant personal advisers (their swift departure another welcome consequence of the vote) had envisaged. Rather than the mantra of strength and stability we had "May-hem", a felicitous term coined by The New York Times. Hubris was followed by near nemesis as the Prime Minister clung to office but not power with the support of the DUP, a party founded by the old Protestant firebrand, Ian Paisley. It was a policy of expediency which some seasoned observers thought might harm the hard-won peace in Northern Ireland.

May's limitations as a significant political figure had been cruelly exposed during the election campaign and Fintan O'Toole in the New York Review of Books went for the jugular.

"The Tories tried to build a personality around a woman who does not have much of a personality," he wrote. "May is a common or garden Home Counties conservative politician. Her stock-in-trade prudence, caution and stubbornness. The vicar's daughter was woefully miscast as the Robespierre of the Brexit revolution, the embodiment of popular will sending saboteurs to the guillotine. She is awkward, wooden, and, it turned out, prone to panic and indecision under pressure."

When Nigel Farage announced that he might have to return to frontline politics because of the deteriorating situation, it became clear that the Brexit project was now under greater threat than at any time since the 2016 referendum. Several influential European politicians now started to queue up to state publicly that even though the hour was late, the UK would still be warmly welcomed back into the European fold if there was a change of heart. Might there therefore be a very small chink of light at the end of the dark tunnel leading to Gotterdammerung for the country?

There are indeed some intriguing auguries. The Tories dare not go back to the country and try again if they can avoid it because the electoral momentum is now firmly with a rejuvenated Labour Party. A hobbled PM and her kitchen cabinet can no longer put the fear of death into Tory Remainers to ensure their silence. The Chancellor of the Exchequer has on several occasions openly attacked the PM's intention to leave the single European market in the knowledge that she cannot now sack him for such independent thinking.

The small group of newly-elected Tory MPs from Scotland have said they would oppose a "hard" Brexit (though their voting behaviour to date suggests that declaration might only be so much hot air). The Prime Minister's new-found friends, the DUP, have expressed the same hostility to such a policy. Real power is moving from Downing Street to the Houses of Parliament. It is said that Remainer MPs are plotting across party lines and that the ultra Remainers, the SNP government and the Scottish Parliament, will yet have the right of consent to some of the agreements under discussion with Brussels. All of them will have the opportunity to make great mischief amid the legal swamp of the Great Repeal Bill and numerous other pieces of related secondary legislation.

There are two little straws in the wind. In late May I had lunch with Michael Russell MSP, the Scottish Government's Brexit Minister, who stressed to me in no uncertain terms that Brexit was inevitable. Then, less than a month later, he admitted before a Committee of the Scottish Parliament that though Brexit was "still the trajectory", he was no longer "100 per cent convinced" that the UK would in fact leave the EU. The General Election of June 8 had made Brexit much less certain, and in his words, "many options" were now possible. Sir Vince Cable, the new leader of the Lib Dem, has been even more forthright. He now thinks Brexit will never happen because "the problems are so enormous, the divisions within the two major parties are so enormous". A second referendum could provide an escape route from disaster for the British people.

Now that Ukip has been at least temporarily eviscerated, some optimists have surmised that the Labour Party might yet embark on a crusade to save the country as much of its surprising level of support in the General Election came from young Remainers. As this article is written, however, that hope seems like pie in the sky. Jeremy Corbyn may simply be playing a canny waiting game by keeping his powder dry until the Tories are rent asunder by their innumerable Brexit contradictions or the polls suggest a decisive movement in public opinion towards Remain. But Corbyn has never had much time for the EU club of capitalists whose regulations would curtail the implementation of socialist policies in the UK if he was able to form a government. Word has it also that he is surrounded by a coterie of Eurosceptics. Whatever the truth of the matter, the same studied ambiguity of the Labour Party on this historic challenge continues to prevail.

All that can therefore be said today is that some battles have been won and others lost but the outcome of the war itself remains uncertain. In the end that will depend on the response of the UK Parliament and, ultimately, on public opinion.

The first signs that attitudes are beginning to change came in a survey by Survation in early July. It found that a clear majority of Britons (54 per cent) would vote to remain in the EU if another referendum was held. In addition, most people agreed that the best outcome was to stop exit talks completely and work to stay in the EU. Less than a quarter supported the Government's strategy of leaving the customs union altogether. People seem to becoming more aware of the dark economic clouds which are starting to gather even though the Brexit discussions have only just begun. Last year the UK had the highest growth rate in Europe; and this year the lowest. The sustained fall in sterling has pushed up inflation and the Bank of England has started to consider raising interest rates.

As this story unfolds, a slowly opening window rather than a chink of light might now seem a more appropriate metaphor.

Sir Tom Devine is Sir William Fraser Professor Emeritus of Scottish History and Palaeography in the University of Edinburgh. He writes here in a personal capacity. His new book, the co-authored Tea And Empire, is published by Manchester University Press

This article was first published in the most recent issue of Open House, an independent magazine of comment and debate on faith issues in Scotland www.openhousescotland.org.uk