What is the relation between comic elements and the melancholy or shocking ingredients of the story?
I do not find much "comic" about Faulkner's story as it is so infused with melancholy and regret that these elements are obscured, at least for me. I suppose one could say that the utter blindness of the town's residents is somewhat comic, for example when they are all disappointed that when Homer supposedly leaves, there "was not a public blowing off." Or when the druggist believes that Miss Emily is purchasing the poison to rid her home of "rats."
But the sheer loneliness and isolation of Emily is predominant. The callousness of the people is paramount. They seem of care only for titilation: "So the next day we all said, she will kill herself"; it seems as if they all hope such a thing might happen for the entertainment and gossip value.
They are all shocked back into something of humanity when they discover not only Homer's corpse, but also the indentation left by Emily's head on the pillow and the single strand of grey hair on the pillow case. Anything that might have been funny evaporates and the reality of their insensitivity is brought to the fore.