From The Uses of Grammar by Rodby and Winterowd:
It may surprise you to know that glamour and grammar are closely related, and that glamour was once associated with magic. In the early eighteenth century, Scottish speakers of English altered grammar to create glamour, which meant enchantment or spell. The word "spell" itself relates both to correctness in language and to the magic of language. In one sense "spell" has to do with the forms of words: the longest river in the United States is spelled M-I-S-S·I-S-S-I-P-P-I. But "spell" also describes words used to invoke magical powers.