Is it permissible to walk in a Reshut Ha'rabim (public domain) on Shabbat with food in one's mouth, or does this violate the prohibition against carrying in a public domain on Shabbat?
The Mishna in Masechet Eruvin (Daf 98) records the view of Rabbi Yehuda that if a person has in his mouth any kind of discharge that he must expectorate, he may not walk four Amot (6-8 feet) in a public domain until he expectorates. Once the given substance is destined to be expelled from one's mouth, it is considered external to his body, and therefore walking with it in his mouth constitutes carrying. The Shulchan Aruch codifies this Halacha (350:3).
By extension, one must ensure not to walk in a public domain on Shabbat with food in his mouth. One violates the prohibition of carrying not only by holding an item in one's hand or having it in his pocket, but also by walking with an external object in his mouth. By the same token, one may not walk from a public domain to a private domain, or vice versa, with food in his mouth. This applies also to areas classified as a "Karmelit," where carrying on Shabbat is forbidden only by force of Rabbinic enactment (as opposed to Torah law).
The Kaf Ha'chayim cites from the Sefer Ha'chasidim that due to this concern, some people had the custom not to eat sesame seeds on Shabbat. Sesame seeds have the tendency to become wedged in between one's teeth, and a person who walks in a public domain with sesame seeds in his mouth violates Shabbat. Therefore, it is commendable to be stringent in this regard and refrain from eating sesame seeds on Shabbat.
Summary: A person who needs to expectorate may not walk on Shabbat in an area where carrying is forbidden before he expels the given substance from his mouth; likewise, one may not walk in such areas with food in his mouth. Due to this concern, there is a laudable custom among some people to refrain from eating sesame seeds on Shabbat.