In II Hermas 5, the divine messenger tells Hermas that the Holy Spirit won't dwell in a person who's bitter and angry. The Holy Spirit is sensitive and gentle, after all, so he can't inhabit the same place as a rancorous spirit! And anger mixed with forebearance makes a person's prayer unacceptable to God.
I don't like this part of Hermas! The reason is that I myself am bitter about many things. I'd like to think that God reaches out to me in compassion when I'm angry, rather than standing aloof on account of my human frailties. And why's the Holy Spirit have to leave because I'm not perfect? Isn't he powerful enough? Christians are told to love (or at least tolerate) complete jerks. Why can't the Holy Spirit?
Hermas reminds me of a book I read by Charles Haddon Spurgeon several years ago: The Saint and His Savior. I love Spurgeon's sermons, but I hated that book! It reeked of "A true Christian should feel this, and not that," and I found that I didn't feel the way Spurgeon wanted. I vaguely recall a few passages in which he said that the Holy Spirit could leave if a person didn't do such-and-such, which was strange, considering Spurgeon embraced Calvinism precisely because it says God's grace is constant for the elect, not dependant on our emotions. So the book was not all that comforting!
At the same time, I can somewhat understand the point Hermas and Spurgeon are trying to make. For one, God is a gentleman. He's not going to force himself on people. I like that, especially since I hate the way some Christians try to shove their religion down people's throats. So, if the Holy Spirit is definitely not wanted, why should he stay?
Second, the Holy Spirit can have a fuller influence if we're not contaminated with bitterness and anger--if we instead rejoice in God and his goodness.
Personally, I'm not going to stop praying just because I have bitterness. I pray to God because I'm imperfect, not because I always feel the right way. And there have been times when God has reached out to me in the midst of my rants, like he's saying, "Now, here's something constructive to think about."
II Hermas 6 is more understanding of human flaws, in my opinion, for there the divine messenger says that Hermas has both the works of the gentle angel of righteousness, and also those of the wicked angel of iniquity. Hermas is exhorted to embrace the angel of righteousness. It's like my Grandpa Pate has said, we need to yield to that right spirit!