Edinburgh-based publisher Canongate signed up the author after discovering his classic works were out of print and started relaunching his most famous novels earlier this year.
The Ayrshire-born author, who is now planning follow-ups to the Laidlaw trilogy, which was launched 1977 about an unorthodox Glasgow-based detective, said he felt as if he had gone through a “biblical resurrection”.
The 76-year-old – who is credited with inventing the “tartan noir” genre – said: “I will say Canongate saved my life financially. I just found it utterly amazing. For me, it was like a biblical resurrection scene.
“A book has got to crystalise for me before I will commit myself to it.
“When I wrote Laidlaw, the publisher said to me: ‘if you can write one of these a year you will become a millionaire’.
“I sometimes lie in bed at night and think, ‘what a chance I missed there.’ I just couldn’t do it.
“But since this amazing resurrection job, I’ve got a lot of notes for further Laidlaw books. I’d like to do two – one a prequel and also a sequel.”
The author was joined at the book festival by Alex Salmond, who blamed McIlvanney for his pursuit of a career in politics.
The First Minister said: “When I left university I applied for a job at the BBC, in 1978.
“When I went for the interview, they asked me what my favourite book was. I said Laidlaw because I had just read it. I realised immediately I had said the wrong thing. It was not impressing them at all.
“One of the panel had never even heard of it. Another one asked me what it was about and when I said it was a crime novel about a Glasgow detective, he said, ‘Oh really?’
“I was totally thrown by their attitude and spent the next hour telling them it was the greatest book that had ever been written and to stuff their job.”