Regiam Maiestatem, Glanvill, and David I
The association of Regiam Majestatem with David I is spurious. The text later known as Regiam Majestatem is in fact based on the English common law tractate known as Glanvill (1187´89), and also contains selections from canon law (identified by Stein as the Summa by Goffredo de Trano, compiled between 1241 and 1246), but our work on the earliest manuscripts shows that actually the compiler of Regiam might have known a whole lot more canon law than just Goffredo. It also contains some unacknowledged sections from 'native law', often thought only to appear in book IV, but actually appearing in books 1, 2 and the start of book IV.
It was not until the late sixteenth and early seventeenth century that the link between Glanvill and Regiam was acknowledged, and the question of which one was the earlier text obviously had powerful contemporary relevance in the context of the Union of Crowns: was Scottish law derived from English law or the other way around? Debates around this question are illuminated in a wonderful article by Hector MacQueen. But despite the fact that the link between Glanvill and Regiam was 'discovered' in the early seventeenth century, and many writers knew that Regiam did, in fact, use Glanvill, the issue remained debated. In the second half of the eighteenth century, David Dalrymple, Lord Hailes, in his wonderfully titled 'An examination of some of the arguments for the high antiquity of Regiam Majestatem', argued vociferously —castigating the then only editor of Regiam, Sir John Skene— that the association with David I was bogus, and thus Regiam was derived from Glanvill, not the other way around.
Lord Hailes laying into Sir John Skene (in his Annals, p. 287)
Alice Taylor, 2017
 H. L. MacQueen, 'Glanvill resarcinate: Sir John Skene and Regiam Majestatem', in A. A. MacDonald, M. Lynch, & I. B. Cowan (eds.), The Renaissance in Scotland: Studies in Literature, Religion, History and Culture offered to John Durkan (Leiden, 1994), pp. 385-403.