Martin Ling knew over lunch. He knew, as he glared at a plate of untouched food, that it was coming back and that's when the fear started.

'What if it's like last time?' he thought. 'Oh s***, why now? Oh f***, what if it's like last time?'

He was sitting with the coach he had brought to Swindon Town, Ross Embleton, and the club's director of football, Seamus Brady. It was November 24, 2015, and the three of them had decided to get something to eat before the League One match against Walsall that night.

Martin Ling has had to battle his demons throughout his career with his last job coming in 2015

Ling suffered with depression in his time at Torquay and left Swindon due to 'health reasons'

But Ling, suddenly, had no appetite. And after what he had been through, he knew this was one of the signs. Panic rippled through him.

He'd only been in the job three weeks, given an opportunity he didn't think would come again, and now this. But it might be nothing, he told himself. 'It might not be that b****** coming back.' Best to focus on Walsall, he reasoned, and that night Swindon won 2-1 for their second victory in three games.

They had been in desperate trouble when Ling arrived on November 3 and now were climbing. But Ling felt nothing but indifference.

'Another sign,' he thought. 'Why aren't you happy? S***. This isn't good.' He walked the corridors of the County Ground that night and several others in the next two weeks, spotting pictures of himself as a player he had never noticed before.

He was part of the Swindon team who reached the Premier League and he played when they got there. This was his club, where the door to one of the bars is covered in his image — the laughing winger in Swindon's most successful side.

Ling earned promotion to Division One with Leyton Orient during the 2005-06 season

It was the club that had given him his return to management after the horrific pain and stigma of his mental breakdown at Torquay in 2013. That episode, with those five weeks in the Priory and the 'barbaric' electroshock treatments, might have ended his time in management. But Swindon chairman Lee Power looked past that for one of their own.

Talking about this might help someone else spot the signs

And now this. Each time Ling ambled past one of his pictures, he felt the same thing. 'I was happy then,' he thought. 'I should be happy now but I'm not. And I know where this goes. I can't let this get as bad as it got at Torquay.'

Five weeks later, he resigned as Swindon boss, 56 days after he had arrived. He had won five of nine games and taken them seven spots up the table. In the same time his condition had taken him back to the place he never wanted to revisit.

Within a fortnight he was lying on a hospital bed at Kingfisher Court, Radlett, as padded electrodes were re-attached to his head. The anaesthetic was administered, a plastic mouthguard was fitted and the shocks began. Just like last time.

Ling resigned from his role as Swindon Town manager after less than two months in charge

It's a cold night in October. Ling is on a school AstroTurf in Loughton, Essex. He is laughing, grinning, coaching.

The kids are about 16, some pretty good, others less so. Ling is out and about and happy, having a ball in the game where he earned a living for 34 of his 50 years. The curtains aren't drawn any more. He has been out of hospital since March and clear of depression, by his estimation, since July.

This is his first interview since he left Swindon, and, based on how he feels today, he reckons he could return to management tomorrow.

It looked so barbaric but at that point I'd take anything

'But I know that would be a big mistake,' he says. 'Even if a club saw past what I've been through, and that is a bloody big if, I have to take my time with this.

'The sorry thing is, I don't honestly know if the depression will be back.' Ling turns up his palms and smiles. 'Right at this moment I am out the other side,' he says. 'I have had three bouts of depression and I'd be naive to assume there won't be a fourth.

'But I also know that talking about all the grisly details might help someone else spot the signs. One in four people suffer mental health problems and you could be a millionaire, a teacher, Gary Speed, anyone.

'If me talking about it helps them, then something good can come from this.'

With that, Ling prepares to run through his extraordinary history with a cruel illness.

Ling was always the joker in his dressing rooms, a 'gobby' left winger who played in each of the top four divisions of English football.

Management had never really been a consideration until he realised in his early thirties that his time as a professional was nearly up after 600-odd games. Barry Hearn gave him a chance at Leyton Orient in 2003 and Ling delivered promotion to League One a couple of years later. His skill was in being able to 'smell' a player's moods.

'I was decent with understanding their emotions, would you believe it,' Ling says.

The former Cambridge United manager has undergone electrotherapy and he is on the mend

He went five and a half years in that first job before the relationship ran its course. Hearn made a tough call to sack a man he liked in January 2009 and Ling had to process it around the same time that his father was seriously ill.

'Each day my mother and family were looking to me with his treatment,' Ling says. 'I was helping to make the decisions and it was tough. At the same time I had to think about what I was going to do in football. Maybe that started something building in the back of my mind.'

The first discernible symptoms of a problem surfaced at Cambridge in his next job. 'I couldn't drop players any more,' he says. 'I started worrying about them, how it would affect their families, that they had mortgages. I found myself tossing and turning all night.'

Ling was part of the Swindon team who reached the top flight and he also played for Brighton

There was also the time, recounted in Michael Calvin's brilliant study of football managers, Living On The Volcano, that he forgot to put gel in his hair one morning in 2009 and flew into a desperate panic on the A1 on his way to meet his players for a trip to Rushden. 'The tiniest setback was becoming a massive anxiety,' he says. 'It was escalating as well.'

Ling took 10 days off work, citing a 'virus', and was prescribed anti-depressants after seeking help from the League Managers Association.

'Looking back now I consider that my first bout of depression,' Ling says. 'At the time, it just seemed a strange time in my life but now it's clear that was the first bout.'

The second was so much more destructive. Ling had joined Torquay in summer 2011 and quickly felt 'something wasn't right' amid the routine of living away from home five nights a week. He was subdued, overly self-critical, questioning his judgments.

'I saw a specialist through the LMA who said I had IOU — Intolerance of Uncertainty,' Ling recalls. 'I told him, 'I'm in the right f****** job then, aren't I?'

The descent from that point to 'total collapse' was rapid. 'I went from feeling subdued to desperation in no time,' he says. 'Terrifying. The next stage — wow.'

He started having panic attacks and random spells of tears, giving rise to a series of imagined illnesses. In one instance, in January 2013, he checked himself into the Royal Devon and Exeter Hospital to be tested for a brain tumour. 'I desperately wanted to be told I had one, anything that explained why I felt that way and it wasn't depression.'

Ling during his playing days with Leyton Orient - he would later win promotion as a manager

Soon after, he was driving on the M5 and thought he was having a heart attack. It was actually another panic attack, but he frantically pulled into Taunton services and called an ambulance. He also phoned his wife to say he was dying.

When paramedics told him there was nothing physically wrong, he wanted to run in front of a car on the motorway.

'I spent five weeks in the Priory after that — credit to the LMA because it cost £60,000 and they covered it all,' Ling says.

With his voice wavering, he adds: 'I was in such a bad way. I remember Dean Smith (his assistant, his best friend and now manager at Brentford) coming in to see me sitting in the dark at the Priory. He opened the curtains and said, 'F****** hell get some light in here'. I was hiding behind my hands.

'I'll always remember him taking me for a walk — he was walking one side of me and on the other was a mutual friend. One was there to stop me jumping over a wall to the railway line on one side and Dean was to stop me jumping in the road on the other. I was just huddled over. Imagine being that gone.'

Against that backdrop, he agreed to the most extreme measure available. 'This woman at the Priory had tried electroconvulsive therapy and it worked,' he says. 'At that point, I'd take anything.

'And this is barbaric. I can only imagine what is happening — my body jolting up, shaking, whatever. I thought it was worth a shot.'

After his fourth session he made a joke to the doctor. 'If I can laugh, it must be working,' he thought. 'Maybe I can live again.'

Swindon had been in desperate trouble when Ling arrived but he left despite a positive impact

For two and a half years after Ling left Devon, he spent much of the time wondering if he would ever get another job. He had initially been placed on leave at Torquay with what had been termed a 'debilitating illness' and his employment was formally ended in spring 2013 after his treatment was concluded.

'Moving on, it was the coffee stain on my c.v,' Ling says. 'Mental illness is a hard thing to overlook.'

He started working again later in 2013, doing bits and pieces of coaching and scouting. There was also a call from Hearn to say a businessman who owned a football club in Thailand needed a manager.

'Eleven hours into a 12-hour flight I started getting wobbly about the whole thing,' Ling says. 'I landed at 6am and got the next flight home six hours later.'

It wasn't until Swindon came calling in the winter of 2015 that Ling had another chance.

'I never thought I'd be back,' he says. 'Then I get a call from Lee Power, the chairman, and we had a great chat. He told me, 'I don't care about the past'. Great to hear. A great chance at a club I loved.'

And yet it would all unravel. 'It never got as bad as Torquay,' Ling says. 'That was a 10 out of 10 disaster. At Swindon, it was maybe eight. But it was the fear of what it might become. I was s******* myself that it was going to be like Torquay.

Ling made 148 league appearances for Leyton Orient towards the end of his playing career

'There was one day around last Christmas, just before I resigned, when I went out for a walk and I remember thinking, 'There's a train line over there'. Who knows what I would have done, but just then I saw Andy Rowland, who had been a coach at Swindon when I was a player there.

'I hadn't seen Andy in years and he had had his own problems. We had a good chat and that just lifted something for me.

'But even then I knew I had to get out of football. I had to nip the problem in the bud. I didn't want it to be like last time.'

The cruelty of depression is it does not obey even the best-laid plans. 'In an ideal world I would have got out and suddenly felt better,' Ling says. 'That didn't happen.'

He had resigned on December 29 and on January 4 checked into the Priory again for two weeks, before spending a further period at the NHS hospital at Kingfisher Court, Radlett. He had 12 more sessions of electroconvulsive therapy.

'I was desperate to try anything, even though that third bout never got as bad as the second, and the ECT had worked in the past,' Ling says. 'Like I say, you fear something so much you'll do anything. This time it didn't really work and that was hard.'

He never quite hit the lows of 2013 but toiled in a fuzzy haze for weeks and months. He recalls watching Euro 2016 'without a single emotion' and a John Bishop DVD 'without even smiling, despite liking the guy'. Then, one day in July, it all seemed a bit better. 'Finally,' Ling thought.

The process in the three months since has been arduous, but the curve points upwards.

A battling Ling can now afford a smile after months of feeling emotionless during the summer

'I'm coaching the kids for now, just getting some routine,' he says. 'I'm also doing some commentary for the BBC and getting out to watch my son play (Sam Ling plays for Dagenham and Redbridge). I'm gradually getting there.'

He is back to making jokes and making plans. He can also see a funny side in darker experiences. 'On that trip to Thailand the guy next to me was asking what I did,' he says. 'I promised him two tickets for the next day's game and I have visions of him turning up to the ticket office and saying, 'Martin Ling left me tickets', and no-one knowing what he was on about.'

Ling laughs. The next hope is that he will find a way back to some level of part-time management, probably around the sixth tier. Two clubs have already been in touch.

'I just don't want to rush,' he says. 'I've been helped by some great people, by my wife, my friends, the LMA, to get to this point.

'Now I need to be sensible. Part of me thinks this would have happened regardless of whether I was in management, but I have to be smart in recognising it probably didn't help. Who knows?

'The strange thing is, I feel strong now. Shamefully, before all this I'd have said depression is a sign of weakness. Now I feel it has made me stronger, a better person.'