HETERIM TO USE A BEIS HA'KENESES OR BEIS MEDRASH
28b - Beraisa: We do not enter a Beis ha'Keneses to avoid heat or rain.
Rav Asi: Batei Kenesiyos in Bavel are made on condition. Nevertheless, we do not act in them frivolously, i.e. to make calculations;
Beraisa: We do not adorn ourselves (in a Beis ha'Keneses)
Rava: Chachamim are permitted.
R. Yehoshua ben Levi: It (a Beis Medrash) is called 'the house of Rabanan'. This shows that they may use it like their home (in all ways).
Rava was teaching Ravina and Rav Acha bar Masnah. A torrential rain came. They entered a Beis ha'Keneses.
They did not enter to avoid the rain, rather, for the sake of learning, which requires clarity.
Rav Acha brei d'Rava: If one must enter a Beis ha'Keneses to call someone:
If he is a Chacham, he should say a Halachah. If he just knows Mishnah, he should say a Mishnah; if not, a verse; if not, he should ask a child to read the verse he is learning, or delay for a short time.
29a - Mishnah: We do not use a Beis ha'Keneses for a shortcut.
R. Avahu: If there used to be a path there, it is permitted.
Rav Nachman bar Yitzchak: If one entered intending not to make it a shortcut, he may make it a shortcut.
R. Chelbo: If one entered to pray, he may make it a shortcut.
Berachos 62b - R. Chelbo: If one entered a synagogue to pray, he may make it a shortcut -- "Ub'Vo Am ha'Aretz... ha'Ba Derech Sha'ar Tzafon Lehishtachavos Yetzei Derech Sha'ar Negev".
The Rif and Rosh (4:7,9) bring our Gemara. Regarding a shortcut the Rif brings only Rav Nachman bar Yitzchak, who permits one who entered intending not to make it a shortcut.
Rif (Sof Berachos and Rosh 9): If one entered a synagogue to pray, it is a Mitzvah to make it a shortcut -- "... Ha'Ba Derech Sha'ar Tzafon Lehishtachavos Yetzei Derech Sha'ar Negev...Lo Yashuv Derech Sha'ar Asher Ba Vo Ki Nichcho Yetzei".
Question (Korban Nesan'el 300): Our text (Berachos 62b) permits making it a shortcut. The verse discusses the Mo'adim; this suggests that it is permitted only then!
Answer (Korban Nesan'el): The verse teaches that on the Mo'adim even the Nasi, who normally enters and leaves from the east, will enter from the north and leave from the south (or vice-versa), like everyone else always does.
Rambam (ibid. 8,10): If the Beis ha'Keneses has two openings, one may not enter through one and leave through the other to make it a shortcut, for one may enter a Beis ha'Keneses only for a Mitzvah. If one entered to pray or learn he may leave through the other opening to shorten his way.
Kesef Mishneh: Why does the Rambam omit the Heter of one who entered intending not to make it a shortcut? No one argues about this! Perhaps the Rambam holds that it is improper to do so.
Rosh (7): Even though Batei Kenesiyos in Bavel are made on condition, we do not permit frivolity. Rather, the condition helps for when they are desolate. Then, one may twine ropes there. Nevertheless, calculations are still forbidden, and one may not seed it until buying it from the Tuvei ha'Ir, for these are disgraceful.
Kesef Mishneh (7): The condition allows benefit from them (even while they are in use), but not lightheadedness, i.e. calculations. R. Yehoshua ben Levi teaches that a Beis Medrash is 'Bei Rabanan'; all the more so a Beis ha'Keneses, which (he himself holds) is less Kodesh is Bei Rabanan. Nevertheless, we needed to answer why they entered during the rain. This teaches that even Chachamim may benefit from a Beis Medrash only when there is no alternative.
Ran (DH Batei): The Ramban explains that the condition allows the city to feed or lodge poor people there if necessary. Also, Chachamim may benefit from them, but only if necessary; they may not enter merely to avoid rain. A Beis Medrash is 'Bei Rabanan', for they learn there all day; a Beis ha'Keneses is not Bei Rabanan.
Shulchan Aruch (OC 151:1): We do not enter to avoid heat or rain. Chachamim may eat or drink there b'Dochak (in pressed circumstances).
Mishnah Berurah (6): Even Chachamim may not make it a shortcut, enter to escape harsh weather, and certainly not be frivolous or speak idly in it.
Rema: Some permit a Beis Medrash to Chachamim even not b'Dochak.
Bi'ur Halachah (DH v'Yesh Omrim): The Ran allows Chachamim even to enter escape bad weather, since it is their house (but frivolity is forbidden). This does not apply to a Beis ha'Keneses, even b'Dochak. The Rema did not specify; it seems that he holds like the Rambam, who allows only eating and drinking. Presumably, other needs are included.
Shulchan Aruch (ibid.): We may not make calculations, unless they are for a Mitzvah such as Tzedakah or redeeming captives. We may eulogize only a mass eulogy, such as for a great Chacham of the city, which everyone attends.
Kaf ha'Chayim (17): When people must meet to discuss needs of the city it is better not to do so in a Beis ha'Keneses, for in gatherings there are always idle words.
Kaf ha'Chayim (18): It is improper to have a Chupah in a Beis ha'Keneses, unless the Beis ha'Keneses was built with this intent. It is better to be stringent not to build with this intent.
Kaf ha'Chayim (19): One should not have musical instruments even in the Ezras Nashim.
Shulchan Aruch (ibid.): If one must enter for his needs, e.g. to call someone, he should read a verse or say a teaching, so it will not look like he entered for his needs.
Mishnah Berurah (4): If one was not learning and it started to rain, he may not enter a Beis ha'Keneses and learn a small amount, since he enters primarily for his own needs. It did not suffice to say that Rava learned after entering the Beis ha'Keneses. This is because one could enter another house. However, one who needs to call someone inside the Beis ha'Keneses needs to enter, therefore it suffices to learn a small amount inside (Sha'ar ha'Tziyon 2).
Shulchan Aruch (ibid.): If he does not know verses or teachings, he should ask a child to read the verse he is learning, or delay for a short time. Being there is itself a Mitzvah - "Ashrei Yoshvei Beisecha".
Bach (DH u'Mah she'Chosav sheha'Yeshivah): Delaying there is the Mitzvah; one need not sit. "Yoshvei" connotes dwelling, not sitting, like it says "Va'Teshvu b'Kadesh".
Rema: He should delay the time to walk two openings (eight Amos; this is about four seconds).
Shulchan Aruch (5): If the Beis ha'Keneses has two openings, one may not enter through one and leave through the other to make it a shortcut. If there was a path there before the Beis ha'Keneses was built, it is permitted. If one did not enter with intent to make it a shortcut, he may make it a shortcut. If one entered to pray, he may leave through a different opening.
Question: The last clause already follows from the previous clause!
Answer (Magen Avraham 7): If one entered to pray, even if he intended from the beginning to make it a shortcut it is permitted. Alternatively, the correct text of the last clause should say it is a Mitzvah to leave through a different opening.
Mishnah Berurah (21): The Acharonim hold that it is a Mitzvah, like the verse suggests. The Ran explains that one leaves through the other opening to show fondness for the Beis ha'Keneses (by traversing it).
Shulchan Aruch (6): One may enter a Beis ha'Keneses with his staff or sack or money-belt.
Source (Kesef Mishneh 10): Even spitting is permitted in a Beis ha'Keneses (Berachos 63a), and it is worse than entering with a staff or sack or money-belt
Magen Avraham (8): Some forbid an exposed wallet. The Beis Yosef permits, for it is no worse than a money-belt.
Kaf ha'Chayim (38): Some are stringent not to enter with a staff. The Bach says that this is not Midas Chasidus, for they are not particular about money-belts or dust on their shoes. Most Acharonim say that it is not haughtiness to be stringent about any or all of these. One who is stringent will be blessed. No one is stringent about a stick if it is hard to walk without it.
Sedei Chemed (brought in Kaf ha'Chayim 45): A Nazir may not shave in the Mikdash, for this is disgraceful. The same should apply to a Beis ha'Keneses. One who makes a big celebration for the Mitzvah of a boy's first haircut, in which we leave the Pei'os, may do so in a Beis ha'Keneses if there is not room in the house. A Chacham may do so in his Beis Medrash.