Shabbos Chapter 23, Mishnah 4. In the previous Mishnah we studied the law of machshichin al hatechum - that a person may walk on Shabbos to the edge of the techum so that he can set out beyond it the moment Shabbos ends, but only for certain purposes. At the end of that Mishnah, Abba Shaul laid down a rule: any matter that one is permitted to speak about on Shabbos, one may also go out to the edge of the techum for. We explained that this rule comes to include two matters, and they are the ones spelled out in our Mishnah.
The text of the Mishnah:
"Machshichin al hatechum lefake'ach al iskei kallah ve'al iskei hames, lehavi lo aron vetachrichin" - a person may walk on Shabbos to the edge of the techum in order to be ready to travel beyond it after Shabbos, for these two purposes:
Iskei kallah - the arrangements needed so that a bride can be married.
Iskei hames - the arrangements needed for a deceased person, including bringing a coffin and shrouds in which he will be buried.
Even though these activities cannot be performed on Shabbos, and as a rule one does not go out to the edge of the techum for things that cannot be done on Shabbos, here, since these are activities of a mitzvah, it was permitted to go out to the edge of the techum for them.
"Venachri shehevi chalilim baShabbos":
The Mishnah continues with the needs of the deceased: "Venachri shehevi chalilim baShabbos, lo yisaped bahen Yisrael, ela im ken ba mimakom karov" - if a non-Jew brought musical instruments on Shabbos, the kind that were customarily used at a funeral in those days, a Jew may not use them for the eulogy and for the needs of the ceremony, unless they were brought from a nearby place, that is, from within the techum.
This refers to a case where the non-Jew brought the instruments for a Jew and not for a non-Jew, and for that reason the Jew may not use them if they were brought from outside the techum. And if it is known that they were brought from outside the techum, one must wait after Shabbos the amount of time it would have taken to bring them from that place outside the techum.
"Asu lo aron vechafru lo kever":
"Asu lo aron vechafru lo kever, yikaver bo Yisrael; ve'im bishvil Yisrael, lo yikaver bo olamis" - the distinction depends on for whom the work was done:
Done for a non-Jew: if non-Jews dug a grave or made a coffin for the needs of non-Jews, a Jew may be buried in it, since it was not done for the Jew.
Done for a Jew: if they did it for a Jew, that Jew for whom it was done may never be buried in it. Another Jew, however, may use it after Shabbos, once he has waited the amount of time it would have taken to make the coffin or to dig the grave.
It should further be noted that this permanent prohibition applies specifically when the non-Jews made the coffin or dug the grave for a Jew in public - in that case that Jew may never use it, out of respect for the deceased. But if they did it privately, it may be used after Shabbos ends, once one has waited the amount of time it would have taken to dig the grave or make the coffin.
In summary: in this Mishnah we learned that one may go out to the edge of the techum for the needs of a bride and the needs of a deceased person, including bringing a coffin and shrouds, even though these are activities that cannot be performed on Shabbos, because they are activities of a mitzvah. We also learned that if a non-Jew brought musical instruments on Shabbos, a Jew may not use them for a eulogy unless they came from a nearby place, and otherwise one must wait after Shabbos bichdei sheya'asu (the time it would have taken to do it). And likewise, a coffin and a grave made for a non-Jew - a Jew may be buried in them; but if they were made for a Jew in public, that Jew may never be buried in them, while for another Jew, or when they were made privately, they are permitted after Shabbos and after waiting the required amount of time.