It was all he could do not to smoke.
What's the meaning of the sentence?
Is this sentence idiomatic?
It was all he could do not to smoke.
What's the meaning of the sentence?
Is this sentence idiomatic?
It is idiomatic. It means: he very nearly gave in to the urge to smoke; he needed all his strength and willpower (it was all he could do) to not smoke. If we say it was all we could do to do (or not do) something, that means we barely (only just) succeeded at doing (or not doing) something.
A man was rude to my mother. It was all I could do not to hit him.
The big dog growled at me, and it was all I could do to stay where I was.
If I see the school bully tomorrow, it might/will be all I can do not to knock him down.
My sister's dog is barking loudly right now, and it is all I can do not to kick him.
The man in trouble in the river weighed 130 kg, and it was all I could do to pull him out.