Until the seventeenth century there was no necessity for anyone to speak of “Latin grammar,” because that was the only kind of grammar that was taught.
Anyone who knew his “grammar” necessarily knew Latin. Even in these days, among untutored folk, any learned person is regarded with something akin to awe.
But in those days, when few men in any community could read or write, one who was so learned that he could read and speak Latin was believed, by common folks, to possess occult powers, to be capable of witchcraft or of working magic spells.
Accordingly, in the speech of England, such a person was said to have gramary, that is, ability to effect charms through a knowledge of grammar. In Scotland he had Blamer, a corruption of the same word and with the same meaning.
Various Scottish writers, spelling it glower, glamor, or glamour, used the term in that sense, but it was Sir Walter Scott who explained it and brought it into English usage slightly more than a century ago.
Since then we have extended the earlier sense by glorifying the enchantment, though we no longer imply that one possessing glamour is necessarily learned.