GLOOMY foreign-policy analysts in Beijing look at Narendra Modi, India’s new prime minister, and see a subcontinental version of his Japanese counterpart, Shinzo Abe. Two right-wing nationalists, elected on platforms of restoring economic growth and national pride, both need to act tough in their countries’ territorial disputes with China. Mr Abe’s tenure has marked a nadir in China’s relations with one big neighbour; so Mr Modi’s victory does not look good for China, either. That is one view. But other Chinese thinkers are cheerier, applauding an apparently chummy meeting this week in Delhi between Mr Modi and China’s foreign minister, Wang Yi. Writing in the Communist Party’s Global Times newspaper, Liu Zongyi, of the Shanghai Institute for International Studies, even predicted that Mr Modi is less likely to be “India’s Abe” than its “Nixon”—a right-wing leader who overcomes distrust to transform relations with China.

The Modi-as-Abe camp can point to a tub-thumping speech Mr Modi made during the election campaign in the north-eastern state of Arunachal Pradesh, which China briefly invaded in a bloody border war in 1962 and over which it still claims sovereignty. Mr Modi was forthrightly patriotic: “I swear in the name of the soil that I will protect this country.” And sure enough, this week it was reported that India is to fortify 54 new border posts. In a foreign-policy speech last October, Mr Modi referred to “Self-Deception”, a book by his party colleague, Arun Shourie, which ridiculed Indian governments’ weak-kneed response to Chinese territorial encroachment, and called for India to “knit a network of alliances” to stand up to China.

China’s leaders were not invited to Mr Modi’s inauguration last month. But in a front seat was Lobsang Sangay, formal head of the exiled Tibetan government-in-exile, which is based in India, is loyal to the Dalai Lama and reviled by China as splittist. This suggests the new Indian government may be more willing to rile China than, for example, the one in 2008, when China paraded the Olympic torch in Delhi ahead of the games in Beijing. Anxious not to offend its neighbour, India deployed over 20,000 troops to protect the torch from possible Tibetan protesters.

Moreover, as if to confirm his ideological kinship with Mr Abe, Mr Modi has announced that he will visit him in Tokyo on his first important foreign trip in office. Mr Abe has recently been suggesting that Japan needs to play a bigger role in regional security, and hinting at the beginnings of what looks like an anti-China front. He has made no secret of his admiration for Mr Modi—drawing attention, for example, to his Twitter account. He “follows” only three people: his wife; a conservative writer and politician; and Mr Modi.

Yet the tenor of this week’s visit by the foreign minister, Mr Wang, made clear that Mr Modi will not lightly let India be drawn into overt antagonism with China. According to the Chinese account, Mr Modi said he “cherishes a friendly feeling toward China”. His priority, after all, is reviving growth and China is India’s largest trading partner, as well as, for Mr Modi, an economic role-model. He visited China several times as chief minister of Gujarat. His first trip was a personal “study tour”, bereft of protocol but equipped with a notebook and pencil. Like Chinese Communist leaders, Mr Modi likes to get things done.

So Mr Wang talked up the potential for economic co-operation (“the emerging tip of a massive buried treasure”) though trade actually fell slightly last year. China likes to talk of the complementarity of the two economies, coupling China’s manufacturing might to India’s strength in services. Mr Modi realises that, to create growth and jobs, India needs to compete with China as a manufacturer.

Economic competition does not preclude political co-operation, nor Mr Modi’s turning out to be India’s Nixon. He has two advantages over his predecessor, Manmohan Singh, in dealing with China. One is his reputation as a hardline defender of Indian rights—in contrast to Mr Singh, who was mocked by opponents as a mild-mannered weakling. The second is that his Bharatiya Janata Party has less reason to be traumatised by the humiliation India suffered in 1962, when Congress was in power.

Give them an inch...

Since 1988, when the two countries agreed to get on with improving relations in other spheres, they have been inching painfully towards a solution to the disputed border, more than 3,000km (1,900 miles) long. They are working on demarcating the de facto boundary. And a deal has long been on the table—in essence the two sides simply keep what they have. Two big obstacles stand in the way. First, China is no longer content with what it has. Of 14 contested sections of the border, one especially seems to matter: Tawang in Arunachal Pradesh. It was there that the 1962 war started. It is also the site of an important Tibetan monastery, and the birthplace of the 6th Dalai Lama. Facing uncertainty in Tibet when the present Dalai Lama (the 14th) dies, China now seems intent on controlling such a sensitive site.

The second obstacle is the political difficulty both countries would have in persuading public opinion to accept big, if notional, territorial concessions. For India it would mean flouting a parliamentary resolution passed after the defeat in 1962 that declared “India will recover each inch of territory lost to the Chinese.” No Indian prime minister could ignore such a call to arms—unless he were absolutely sure no one would impugn him as weak, unpatriotic or pro-China. Mr Modi might fit that bill. But reaching a formal settlement with China is probably a long way down his list of priorities. Neither India’s Abe nor its Nixon, as far as relations with China are concerned, the new prime minister may turn out to be that now rather unfairly despised creature, Manmohan Singh, mark 2—setting aside an ambitious political settlement in favour of an incremental improvement in commercial ties.