Jonathan Miller told that story last night in the first episode of his TV History of Unbelief. He also quoted from Jefferson, Adams, Buchanan and Lincoln to demonstrate that all of them would have been unelectable by today's strict standards of religious conformity.
Lincoln wrote that the more he thought about it, the more he felt bound to reject the Christian scheme of salvation.
But, then again, back in those days, the politics of the Republic attracted men of genius. Who was the last president you could describe in those terms and it not seem utterly ridiculous?