Macdonald was appointed Lord Advocate in 1885 and was shortly after elected to Parliament. While holding this office he brought forward a Bill to amend and simplfy criminal procedure in Scotland. It was, he records, a "bulky Bill" containing some 77 clauses, and he was advised by parliamentary colleagues that a Bill of this length had little chance of passing. That it passed was then due to chance. The Irish Nationalists withdrew from the House in protest at a government bill on Ireland, which was then passed quickly. Macdonald's Bill was then brought forward, and as this was to be followed by a Scottish licensing bill which had opposition support, this also was pushed through in llittle more than an hour and a half.
Such are the origins of codified criminal procedure in Scotland - no grand plan, and enactment without proper review. In certain respects, then, it is surprising that it has worked so well for so long. but after 125 years of amendment and accretion of clauses it might be time to review and simplify the law.