Translation:Shulchan Aruch/Orach Chaim/288
1. Ruling of a fast and ruling of a fast for a dream on Shabbat; contains 10 subsections. It is forbidden to fast until six hours on Shabbat. Rem"a: and even for the purpose of learning or praying, it is forbidden [to fast] [Mordechai]
2. Some say that a person who is harmed by eating, such that it is their delight not to eat, should not eat. Rem"a: And so with one who finds delight in weeping, in order that their pain will leave their heart: such a person is permitted to weep on Shabbat. (Igur in the name of the Shibolei haLeket)
3. Regarding a person who fasts every day, and eating on Shabbat is painful for him because of the change in routine (explanation: a fixed thing), some say they have seen many pious and noble people who have fasted on Shabbat because of this reasoning, and they say that so acted Rabbi Yehuda heChasid.
4. It is permitted to fast the fast of a disturbing dream on Shabbat, in order that the decree of judgement may be torn up -- and they need to fast on Sunday, in order to atone for nullifying the delight of Shabbat. And if their strength is weakened and they can't fast two consecutive days, they don't have to fast on Sunday and should fast after that. Rem"a: Also, if Sunday is Chanukah or Purim or a festival, even the second day of a festival in the Diaspora, one shouldn't fast until after then. Some say, one who had a nap in the middle of the day and dreamt a bad dream should fast from noon to midnight and then make havdalah, and fast on Sunday -- it's as though that person fasted the whole day of Shabbat. (I found it written)
5. Some say that there's no justification to fast for a dream on Shabbat unless it's a dream one saw three times. And some say at this time we don't fast dream fasts on Shabbat because we aren't experts in dream interpretation and don't know which dreams are good and which are bad. And everyone says that it's found in ancient books that on three dreams we fast on Shabbat: one who sees a Sefer Torah burnt, or on Yom Kippur at neilah, or the beams of one's house, or his teeth that fall. And some say that one who sees Yom Kippur, even not at neilah, and some say one who sees that they are reading from the Torah, and some say one who sees that they have married off a woman, and he sees his teeth fall out, specifically his teeth. If, however, he sees that his jaws fell off, it is a good omen; [it is] a sign that those who offer harmful counsel against him have died. It seems to me that the dreams delineated in the paragraph that one sees that they are bad, also over them one may fast on Shabbat.
6. One who fasts on Shabbos because of a [disturbing] dream must recite the passage Aneinu without concluding [it with a blessing] after he finishes his [Shemoneh Esreh] prayers. It is also desirable to recite the passage, “Master of the worlds, it is known and revealed before You…”. RAMA: And one says after his prayer 'רבון העולמים גלוי כו' like during the week.
7. If eating earlier on Shabbos than one’s usual time during the week is a source of pleasure for a person, (e.g., his Friday evening meal has already been digested), he should eat earlier. [Conversely,] he should delay his meal if delaying [and eating] at a later time than during the week is pleasurable for him. For [him,] this is an expression of honor [for the Shabbos] that he will have a desire to eat and eats with appetite. RAMA: and likewise he who eats throughout the day like during Shabbat should change this behavior on Shabbat to eat earlier or later. (Gemara; Tur)
8. We do not fast regarding troubles that occur generally.
9. We do not yell out and we do not afflict ourselves over any troubles except troubles of the times; we cry out by mouth on Shabbat and not with a shofar. Likewise regarding a city that is surrounded by non-Jews, or a river and a boat which are torn apart at sea; And even over an individual who is persecuted or oppressed by a non-Jew; or a thief; or a bad spirit; we cry out and say supplications in our prayers on Shabbat, but we do not blow a shofar, unless we blow to gather the nation to help their brethren and to save them (and see Siman 576 Seif 3).
10. One who is bothered by a bad spirit as we said, this is not specific; for this is the law for all illness that contains a danger of the day. We cry out and say supplications. And such is our custom to say מצלאים on Shabbat over the sick who are in danger with the dangers of the day. RAMA: And therefore it is permitted to bless the ill person who is in danger during the day. (Likutei Mahar"i Berin; Beis Yosef in the name of the R"an, perek 3 of fasts).