SILVIA CATALÀ, a publisher in Barcelona, used to live in Glasgow. On September 18th her social-message apps filled up with photographs from Glaswegian friends of the red and gold Catalan flag being waved by activists from the north-eastern Spanish region, visiting for Scotland’s referendum on independence. Back in Barcelona the Loch Inn, a Scottish bar, showed its support by serving haggis with neeps and tatties (turnips and potatoes).

Even forlorn and far-flung separatist hopes were briefly fanned: in the run-up to the Scottish vote the Texas Nationalist League said it was “paving the way” for the secession of Texas from the United States. Catalonia is not the only place where die-hards have found inspiration even in Scotland’s eventual No. Separatists in Quebec, who have twice lost referendums, and where the Parti Québécois (PQ), the main separatist party, has recently suffered a crushing defeat in a provincial election, have started to hope again, too. And the wording of the Scottish vote, the response of national governments to the possibility of defeat and the differing fortunes of the three nations’ separatists hold lessons for governments and independence movements around the world.

Since 2008 the Catalan independence movement has been boosted by the euro crisis and by Spain’s economic travails. The region is one of Spain’s richest; locals believe they are held back by an inept Madrid government. Their cause was strengthened in 2010 by widespread outrage after the country’s constitutional court overturned parts of a 2006 Catalan self-government charter that referred to the region as a “nation” and further privileged the Catalan language. In recent years Catalonia’s national day, September 11th, has seen huge marches for independence.

The day after Scotland’s vote Artur Mas, the Catalan president, steered a law allowing local referendums through Catalonia’s parliament. As The Economist went to press he was due to announce a non-binding referendum for November 9th. The Spanish prime minister, Mariano Rajoy, is expected to ask the constitutional court to overturn the law and halt the referendum (the constitution says only the central government may call referendums on major issues). But Mr Mas is showing no sign of backing down.

Catalan separatists contrast Mr Rajoy’s stance with that of David Cameron, Britain’s prime minister. “We could have blocked [the referendum]…but I am also a democrat,” he said after the vote. Mr Mas says that all Catalans seek is the chance to make a similar choice. Catalan separatists also think Mr Cameron was right to say that, if he had not agreed to a referendum, Scottish separatism would have been given a fillip. “The [Spanish] government has helped us a lot,” says Carme Forcadell, head of the Catalan National Assembly, a pressure group founded in 2012 that has helped push support for separatism to historic highs. Polling results are mixed. Although three-quarters of Catalans say they want a referendum, only around half identify as separatists.

If Mr Mas bows to a ban imposed by the centre it would enrage the fervently separatist Catalan Republican Left (ERC) party which props up his minority government. He might turn to Catalonia’s Socialists, who oppose any referendum not supported by the central government. He could defy the constitutional court, face arrest and see Catalonia’s self-government suspended. Or he could resign and call elections: a resounding victory for separatist parties would be hard for the national government to ignore. But the ERC, historically more hardline than Mr Mas’s own Convergence and Union coalition, would probably emerge the biggest winner.

From aye to oui

Quebec has experienced no similar separatist surge. Referendums on independence were lost in 1980 and 1995. The second of those losses, by a wafer-thin margin, seems to have been a high-water mark for separatism. The PQ, whose vote share is a reliable indication of separatist sentiment, was tossed out of power in April and is now leaderless.

Young voters, who used to be keenest on independence, had been leaving in droves. But after witnessing the campaign in Scotland they have started to come back, says Jean-François Lisée, a potential PQ leadership contender. The negotiations between the British and Scottish governments on holding the referendum, the respect for campaign-spending limits and the simple majority required for secession were also fine examples for Canada, he adds—and very different from Quebec’s previous two votes.

The federal Clarity Act passed in 2000 gave the government in Ottawa the right to decide whether the question posed in any future referendum on independence was clear and whether a “clear majority” had been achieved. A Yes vote would merely trigger negotiations with the federal government. Legal separation would then require amending the constitution, a slow and difficult process. “The Canadian way has been completely rebuffed by the British government,” says Mr Lisée. “That’s a very powerful message.”

Another lesson from Scotland for Quebec’s separatists is the importance of winning immigrants over to the independence camp. A big reason for the PQ’s failure in April was its proposal for a “charter of values”, banning the display of “conspicuous” religious symbols in public buildings or by public employees. This alienated many of Quebec’s 1m immigrants and many voters in multicultural Montreal.

Identity politics was not completely absent in Scotland, says André Lecours of the University of Ottawa, who studies independence movements and was in Edinburgh for the vote. But overall Scotland’s nationalists presented an inclusive vision of the country’s future as an independent nation. Eligibility to vote depended on residency, rather than place of birth. Both Mr Lisée and Bernard Drainville, the minister behind the charter and another potential leadership candidate, have noted that the Scottish separatists’ commitment to inclusion seemed to help their cause.

Perhaps the most important lesson Quebec can offer Britain—and all governments with restless regions—is that the losing side will watch closely to see whether promises made in the dying days of a campaign are kept. As the polls briefly swung in favour of Scottish secession, Mr Cameron said that, if Scotland stayed, it would continue to be favoured in the allocation of public money, and would be granted new powers on matters such as taxation and welfare spending. Those promises are now proving a headache. But should Mr Cameron be tempted to fudge, he should note that the Canadian federal government’s reneging on promises made before the 1980 vote led directly to the referendum in 1995—and continue to keep the separatist dream alive today.