E. Cobham Brewer 18101897. Dictionary of Phrase and Fable. 1898.
Whimsical, full of whims and fancies. Fancy tunes used to be called maggots, hence we have Barkers maggots, Carys maggots, Drapers maggots, etc. (Dancing Master, 1721.)
When the maggot bites. When the fancy takes us. Swift tells us that it was the opinion of certain virtuosi that the brain is filled with little worms or maggots, and that thought is produced by these worms biting the nerves. If the bite is hexagonal it produces poetry; if circular, eloquence; if conical, politics, etc. (Mechanical Operation of the Spirit.)
Instead of maggots the Scotch say, His head is full of bees; the French, Il a des rats dans la tête; and in Holland, He has a mouses nest in his head. (See BEE.)