“Like it or not, there is a deep psychic importance to that whole set of rules and conventions for writing which we tend to sum up loosely as grammar. Grammar is glamour. They are the same word. Like channel/canal or guard/ward or porridge/pottage, the two words just started out as two pronunciations of the same word — a mere matter of regional accent. For grammar was glamour. If you knew grammar you were special. You had prestige, power, access to magic; you understood a mystery; you were like a nuclear physicist.”
Peter Elbow in Writing With Power
“In classical Greek and Latin the word [grammatica] denoted the methodical study of literature (= ‘philology’ in the widest modern sense, including textual and æsthetic criticism, investigation of literary history and antiquities, explanation of allusions, etc., besides the study of the Greek and Latin languages. Post-classically, grammatica came to be restricted to the linguistic portion of this discipline, and eventually to ‘grammar’ in the modern sense. In the Middle Ages, grammatica and its Romance forms chiefly meant the knowledge or study of Latin, and were hence often used as synonymous with learning in general, the knowledge peculiar to the learned class. As this was popularly supposed to include magic and astrology, the Old French gramaire was sometimes used as a name for these occult sciences. In these applications it still survives in certain corrupt forms, French grimoire, English GLAMOUR n., GRAMARYE n.”
from OED