John Gill's Exposition of the Whole Bible
Psalms 140 - Introduction
INTRODUCTION TO PSALM 140
To the chief Musician, A Psalm of David. This psalm, A ben Ezra says, was composed by David before he was king; and Kimchi says, it is concerning Doeg and the Ziphites, who calumniated him to Saul; and, according to our English contents, it is a prayer of David to be delivered from Saul and Doeg. The Syriac inscription is,
"said by David, when Saul threw a javelin at him to kill him, but it struck the wall; but, spiritually, the words of him that cleaves to God, and contends with his enemies.''
R. Obadiah says, it was made at the persecution of David by Saul, which was before the kingdom of David; as the persecution (of Gog) is before the coming of the Messiah. It is indeed before his spiritual coming, but not before his coming in the flesh; and David may be very well considered in the psalm as a type of Christ, for he was particularly so in his sufferings, as well as in other things.