When Messenger of Allah ﷺ besieged Taif and could not conquer its people, he said, "We will return (to Medina) If Allah wills." That distressed the Companions (of the Prophet ﷺ and they said, "Shall we go away without conquering it (i.e. the Fort of Taif)?" Once the Prophet ﷺ said, "Let us return." Then the Prophet said (to them), "Fight tomorrow." They fought and (many of them) got wounded, whereupon the Prophet ﷺ said, "We will return (to Medina) tomorrow if Allah wills." That delighted them, whereupon the Prophet ﷺ smiled. The sub-narrator, Sufyan said once, "(The Prophet) smiled."
لَمَّا حَاصَرَ رَسُولُ اللَّهِ ﷺ الطَّائِفَ فَلَمْ يَنَلْ مِنْهُمْ شَيْئًا قَالَ إِنَّا قَافِلُونَ إِنْ شَاءَ اللَّهُ فَثَقُلَ عَلَيْهِمْ وَقَالُوا نَذْهَبُ وَلاَ نَفْتَحُهُ وَقَالَ مَرَّةً نَقْفُلُ فَقَالَ اغْدُوا عَلَى الْقِتَالِ فَغَدَوْا فَأَصَابَهُمْ جِرَاحٌ فَقَالَ إِنَّا قَافِلُونَ غَدًا إِنْ شَاءَ اللَّهُ فَأَعْجَبَهُمْ فَضَحِكَ النَّبِيُّ ﷺ وَقَالَ سُفْيَانُ مَرَّةً فَتَبَسَّمَ قَالَ قَالَ الْحُمَيْدِيُّ حَدَّثَنَا سُفْيَانُ الْخَبَرَ كُلَّهُ