كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
5  
The Book of Mosques and Places of Prayer
(16)
Chapter: It is disliked to offer salat in the presence of food that one wants to eat. It is disliked to offer salat while restraining the urge to relieve oneself, and so on
(16)
باب كَرَاهَةِ الصَّلاَةِ بِحَضْرَةِ الطَّعَامِ الَّذِي يُرِيدُ أَكْلَهُ فِي الْحَالِ وَكَرَاهَةِ الصَّلاَةِ مَعَ مُدَافَعَةِ الأَخْبَثَيْنِ
Sahih Muslim 560 a

Ibn Atiq reported:

Al-Qasim was in the presence of 'A'isha (Allah be pleased with her) that I narrated a hadith and Qasim was a man who committed errors in (pronouncing words) and his mother was a freed slave-girl. 'A'isha said to him: What is the matter with you that you do not narrate as this son of my brother narrated (the ahaditb)? Well I know from where you picked it up. This is how his mother brought him up and how your mother brought you up. Qasim felt angry (on this remark of Hadrat 'A'isha) and showed bitterness towards her. When he saw that the table had been spread for 'A'isha, he stood up, 'A'isha, said: Where are you going? He said: (I am going) to say prayer. She said: Sit down (to take the food). He said: I must say prayer. She said: Sit down, ) faithless, for I have heard the Messenger of Allah (ﷺ) say: No prayer can be (rightly said) when the food is there (before the worshipper), or when he is prompted by the call of nature.
حَدَّثَنَا مُحَمَّدُ بْنُ عَبَّادٍ، حَدَّثَنَا حَاتِمٌ، - هُوَ ابْنُ إِسْمَاعِيلَ - عَنْ يَعْقُوبَ بْنِ مُجَاهِدٍ، عَنِ ابْنِ أَبِي عَتِيقٍ، قَالَ تَحَدَّثْتُ أَنَا وَالْقَاسِمُ، عِنْدَ عَائِشَةَ - رضى الله عنها - حَدِيثًا وَكَانَ الْقَاسِمُ رَجُلاً لَحَّانَةً وَكَانَ لأُمِّ وَلَدٍ فَقَالَتْ لَهُ عَائِشَةُ مَا لَكَ لاَ تَحَدَّثُ كَمَا يَتَحَدَّثُ ابْنُ أَخِي هَذَا أَمَا إِنِّي قَدْ عَلِمْتُ مِنْ أَيْنَ أُتِيتَ ‏.‏ هَذَا أَدَّبَتْهُ أُمُّهُ وَأَنْتَ أَدَّبَتْكَ أُمُّكَ - قَالَ - فَغَضِبَ الْقَاسِمُ وَأَضَبَّ عَلَيْهَا فَلَمَّا رَأَى مَائِدَةَ عَائِشَةَ قَدْ أُتِيَ بِهَا قَامَ ‏.‏ قَالَتْ أَيْنَ قَالَ أُصَلِّي ‏.‏ قَالَتِ اجْلِسْ ‏.‏ قَالَ إِنِّي أُصَلِّي ‏.‏ قَالَتِ اجْلِسْ غُدَرُ إِنِّي سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ ‏ "‏ لاَ صَلاَةَ بِحَضْرَةِ الطَّعَامِ وَلاَ وَهُوَ يُدَافِعُهُ الأَخْبَثَانِ ‏"‏ ‏.‏
Reference : Sahih Muslim 560a
In-book reference : Book 5, Hadith 84
USC-MSA web (English) reference : Book 4, Hadith 1139
  (deprecated numbering scheme)