As/when/if the spirit moves you British clause
Someone does something when they feel it is the right time.
I love home-made food, but I'll eat out if the spirit moves me.
He travels abroad when the spirit moves him.
I have no idea what he will do, he usually acts as the spirit moves him.
It is unclear information about the origin of the expression, but a source says that it came from the work 'The Quaker Doctrine of the Holy Spirit' in 1959.
People are always inclined to flatter or please a rich man by laughing at his joke which may not be a very good one.
Everyone at the table always flatter the boss by praising his humor. A rich man's jokes are always funny.