The mathematical classes were not repeated in the following session, but the chemical lectures were resumed, and carried on twice a week with increased enthusiasm. The lectures were subsequently repeated at Kilmany and at Cupar. Once, when at a loss for means to assist a friend at Kirkcaldy, who had been associated with him in the volunteer service, the chemical lectures were trotted out to the rescue. It was necessary, when he went to a town, to carry materials for experimenting with him, and Dr. Hanna tells how on one occasion one of the bottles that hung from his saddlebag having been broken, the contents were discharged on the flank of his horse, where they left a discoloured belt to tell the tale. Of this accident the present writer remembers to have heard a more detailed version, according to which the accident to the bottle, which contained sulphuric acid, was not discovered till he was in the class-room. The moment it was perceived, Chalmers, in great excitement, exclaimed, 'Oh, my poor beast!' and rushed from the lecture-room to the stable to do whatever was possible to relieve the sufferings of the unfortunate animal.
It did not escape the notice of the Presbytery that the minister of Kilmany was so much occupied with work outside his parish. But the standard of ministerial activity was low, and Chalmers had not much difficulty in defending himself. In a very short time his thoughts were again turned to the university, but in another connection. The chair of natural philosophy became vacant, and he entered the lists as a candidate. But as the election was in the hands of the professors, he could not have seriously dreamt of success. Nor was he much concerned for his failure. 'My contempt,' he wrote, 'for the low, shuffling artifices of college politics supports and elevates my mind against the vexation of regret.'
A few weeks later, in January 1805, the University of Edinburgh lost one of its most eminent professors--Dr. Robison, of whom mention has already been made. Professor Playfair obtained his chair, leaving that of mathematics, which he had held before, to be filled up. Chalmers was again in the field, but no qualifications that he could appeal to were a match for those of the successful candidate--Mr. (afterwards Sir John) Leslie. In the course of the contest he came for the first time before the public as an author. Among the candidates was the Rev. Dr. Macknight, one of the ministers of Edinburgh, in opposition to whom Professor Playfair had written to the patrons, remonstrating against such a conjunction of offices. Mr. Chalmers's pamphlet (which was anonymous) was entitled, _Observations on a passage in Mr. Playfair's Letter to the Lord Provost of Edinburgh, relative to the Mathematical Pretensions of the Scottish Clergy_. He had ceased to have any personal interest in the case, and his whole object was to show that a Scottish clergyman might be abundantly qualified for the duties of a chair in addition to those of a parish. 'The author of this pamphlet,' he said, 'can assert from what to him is the highest of all authority, the authority of his own experience, that after the satisfactory discharge of his parish duties, a minister may enjoy five days in the week of uninterrupted leisure for the prosecution of any science in which his taste may dispose him to engage.' When the religious views of Mr. Chalmers underwent the great change which will be described afterwards, he was much distressed for this publication, and did his utmost to withdraw it from circulation. In a discussion on pluralities in the General Assembly some years afterwards, he argued vehemently against both the principle and practice of pluralities; and, being twitted with having at one time pronounced in their favour, he candidly admitted that he had done so, but it was in the days of his spiritual blindness. The chair involved was a chair of mathematics. 'What, sir,' he asked, 'are the objects of mathematical science? Magnitude and the relations of magnitude. But then, sir, I had forgot two magnitudes: I thought not of the littleness of time; I recklessly thought not of the greatness of eternity!'