I have discussed davening, so now it's time for shokeling. Shokeling (the Anglicized form of this Yiddish word) or swaying during prayer and Torah study has been treated in many places, all of which bring the same sources. I'm going to bring some of these too, since they are interesting, but what I also found interesting was the various approaches which the individuals discussing them brought to the table.
Later sources connect it with specific verses and the like, and since the existence of the custom is already documented and since I don't think a 16th century source giving yet another verse which hints to the idea of movement is likely to be the actual source which inspired Jews to move during prayer and study, I won't mention them.
The early sources which are incidentally Spanish are as follows.
The first source is critical. This is not surprising since very often the first time anyone takes the time to document something is to knock it. The first source is a poem of Shemuel Ha-naggid. In this poem he is criticizing the degeneration of Torah study since the time of Rav and Rava, and the students and their roshei yeshiva nowadays who are sub-par in wisdom. Nowadays, writes this man of the 11th century, one only needs tzitzis a turban and a beard to be a rosh yeshiva (ידמו כי בציציות וזקן ומגבעת יהי איש ראש מתיבה). As an example of their lack of orderliness he mentions their shokeling:
והנה רב ותלמידים מנידים לראשיהם כערער בערבה
"The teacher and students were bobbing their head like a tamarisk in the wilderness."
The poem is pretty scathing. It even accuses them of basically murdering Hillel and Shammai and Rabbi Akiva (in the sense that we say that a horrible singer "murders" the tune).
This then is the first incidental mention of shokeling, at least in Jewish sources. Notice that it only mentions it in connection with studying.
Next is the Kuzari, who is kinder. He comes not to criticize or praise but to explain. Rabbi Yehuda Ha-levi, who was born some time after Shmuel Ha-nagid died, deals with it in his book. Here it is, in Hartwig Hirschfeld's translation:
79. Al-Khazari: I should like to ask whether thou knowest the reason why Jews move to and fro when reading the Bible?80. The Rabbi: It is said that it is done in order to arouse natural heat. My personal belief is that it stands in connexion with the subject under discussion. As it often happened that many persons read at the same time, it was possible that ten or more read from one volume. This is the reason why our books are so large. Each of them was obliged to bend down in his turn in order to read a passage, and to turn back again. This resulted in a continual bending and sitting up, the book lying on the ground. This was one reason. Then it became a habit through constant seeing, observing and imitating, which is in man's nature. Other people read each out of his own book, either bringing it near to his eyes, or, if he pleased, bending down to it without inconveniencing his neighbour. There was, therefore, no necessity of bending and sitting up. We will now discuss the importance of the accents, the orthographic value of the seven principal vowel signs, the grammatical accuracy resulting from them as well as from the distinction between Qames, Patah, Sere and Segol.
I left in the last part because I love that transition! "Enough shokeling, let's talk about nekkudot and te'amim!"
We see that R. Yehuda Ha-levi too only discusses it in the context of studying, but doesn't mention praying. He gives two reasons. The first is one which people say, that it is to arouse heat in the body, I guess like a form of exercise. Alternatively, he means to arouse passion, to get into it. Then there is the reason preferred by the author, which is his suspicion that originally it was because people shared books and they moved in and our of the way so they could read and give others a chance to read and ultimately this became the habit and spread.
Interestingly, the context in which this question is asked is as follows: the King was asking about Hebrew poetry using Arabic meter. This was a pet peeve of R. Yehuda Ha-levi, so he laments it and explains it as an unfortunate fact of the exile among foreign nations. He opines that piyut, which employs only rhyme, can remedy the situation. However, notes R. Yehuda, authentic Jewish chant is exquisite. He says that you can see 100 Jews reciting the Bible together flawlessly, and the King agrees that you can see that. Immediately following R. Yehuda's explanation that the poetry he disapproves of is due to non-Jewish influence, the King asks about shokeling. Evidently he wanted to know why it is that only Jews do this, if they have been influenced. I'm sure many readers have seen videos of Islamic madrassahs were the students seem to shokel when they study. Apparently this was not the case 1000 years ago, or at least not in Spain.
The Zohar mentions it too, but we will return to that. Further Spanish sources are the Ba'al Haturim (recognizing that he was born in France) and Abudraham. These gives associations with verses and are later (and also associate with praying).
The Zohar (Parashas Pinchas) gives the following:
We arose and went on our way, the sun becoming stronger and more oppressive. We saw some trees in the wilderness with water underneath, and we sat down in the shade of one of them. I asked him: How is it that of all peoples of the world, only the Jews sway to and fro when they study the Torah, a habit which seems to come natural to them, and they are unable to keep still? He replied: You have reminded me of a very deep idea which very few people know. He pondered for a moment and wept. Then he continued: Alas for mankind who go about like cattle without understanding. This thing alone is sufficient to distinguish the holy souls of Israel from the souls of heathen peoples. The souls of Israel have been hewn from the Holy Lamp, as is written, “The spirit of man is the lamp of the Lord” (Prov. xx, 27). Now once this lamp has been kindled from the supernal Torah, the light upon it never ceases for an instant, like the flame of a wick which is never still for an instant. So when an Israelite has said one word of the Torah, a light is kindled and he cannot keep still but sways to and fro like the flame of a wick. But the souls of heathens are like the burning of stubble, which gives no flame, and therefore they keep still like wood burning without a flame.’ Said R. Jose: ‘That is a good explanation; happy am I to have heard this.’ (Soncino translation.)
We see here, once again, only mention of swaying during Torah study, but not prayer. Furthermore, we also see the idea that only Jews shokel, like in the Kuzari. The answer given here is that a Jew shokels like a flame dances.
One of the best accounts of shokeling, where all these sources are discussed in depth, is Senior Sach's article in Alexander Zederbaum's מצפה (St. Petersburg 1885). Sachs is of the opinion that the Zohar is a 13th century Spanish work, so he explains that here we see the influence of the Kuzari on the Zohar, which has R. Jose asking the King's question, why do only Jews sway when they study? Furthermore, he interestingly notes that the בוצינא קדישא (who replies to R. Jose in the quoted passage) is a translation of Gabirol's concept of אש השכל, his terminology for the divine flame from which the soul is in part created. Sachs cites this as further evidence of Spanish influence on the Zohar.
Sachs goes on to show that while in Spain apparently they only swayed during Torah study, in France it became the practice to sway during prayer also, and from there to Germany, East Europe, etc. (He also asks how the Vilna Gaon can cite the Zohar for swaying during prayer, as he does in OH 48, to the Rema's comment that the medakdekim are accustomed to sway during Torah study. So who says the chokrim aren't interested in the Shulchan Aruch and its commentaries?)
Sachs also brings later critics of shokeling, such as R. Menachem Azaryah and the Shelah. He concludes by noting that many early sources who mention it positively give it as the practice of special people, rabbanim, medakdekim, chasidim, vasikin, perushim, etc. But now we all do it, because we are all medakdekim, chasidim, vasikin, etc. and we do it sitting, standing, praying, studying, for joyous praise, for lamentations, etc. He finishes by stating that it does not have an early source (in contrast, the Artscroll siddur commentary has no problem calling even something which dates to the time of the Ge'onim "ancient") and no one can really explain its origin. And he notes that even the Rema, who sanctified this custom, quotes the Rambam in literally his very first note to the Shulchan Aruch, Moreh Nevukhim III.52 that a person must conduct himself with a special comportment in the presence of God, even much more so than how a person conducts himself differently before a king than he does in the privacy of his home. So, says, Sachs, just as one would not fidget in front of a king all the more so is it inappropriate in prayer before God! Readers who are interested in his essay should email me and request a copy.
Stepping a little out of chronological order, in the Encyclopedia Otzar Yisrael, Eisenstein begins his entry נענוא Vol. 7 pg. 87 saying that the practice is very ancient, and rather than citing the Kuzari or Shmuel Ha-nagid, he cites the Zohar. For him the Zohar is a very ancient source. Since almost all of his material is from Sachs, it would seem that he presented it this was on purpose and to show preference to the Zohar. Eisenstein adds an additional source, which is simply a curiosity. He cites the physician Simon Brainin's popular medical book ארח לחיים (Vilna 1883) who explains that shokeling is healthy exercise! Indeed, it may well be for people who don't otherwise get much else. (See here pg. 126.)
After Sachs was Abraham Berliner, who sees it as an issue related to printing of all things. He included his views in his essay on the influence of printing on Jewish practice, which was included in the 1893-94 yearbook of the Hildesheimer Rabbinical Seminary where he taught. In addition to the German original (Über den Einfluss des ersten hebräischen Buchdrucks auf den Cultus und die Cultur der Juden) the essay is available in Hebrew translation (השפעת ספרי-הדפוס הראשונים על תרבות היהודים) in Ketavim Nivcharim, a translated collection of his essays. Berliner cites the same sources, but he got them from Salomon Plessner's 1839 book on prayer אבן טובה.
Evidently he assumes the true origin was the personal explanation of the Chaver in the Kuzari, namely the dearth of manuscripts, which meant that people had to share them, and they began to move out of the way to give others a chance to read. Berliner sees this practice as interesting because even though, in his view, it began due to a lack which printing addressed, the practice persists even after printing. This is why he included his comments about shokeling in his essay.
This reminds me of an explanation given by the Rogachover for why the ten sons of Haman are read by everyone. The practice is for everyone to read them out loud before the ba'al keriah reads it. Normally you are yotze with his reading (shome'ah ke-oneh), but here it is a special case because in addition to the reading there is a special requirement to read it in one breath. So there is no shome'ah ke-oneh for this requirement, and that's why we read it ourselves (in one breath, according to the view that everyone should read it). Someone pointed out that maybe this explains why the words are written large. Not everyone has a kosher megillah, and you would not fufill the obligation from reading in a Chumash. Therefore perhaps these words are written very large so that you can read them in one breath from the megillah of someone sitting near you. But I digress.
Berliner does add one interesting point, but he fails to give a source. He claims that there are Islamic sources warning against Judaizing, who mention the practice as something to avoid. They cited a hadith where Muhammad allegedly shouted to his followers, Do not be like the Jews who move back and forth when they read the Torah! Without knowing what this source is, one doesn't know if it is earlier than Shmuel Ha-nagid or the Kuzari.
The Wikipedia entry, which admittedly is only a stub, mentions that the practice can be traced at least as far back as the 8th century, and possibly Talmudic times. It gives no source, but appears to be referring to the JPS Guide to Jewish Traditions by Ronald Eisenberg (pg. 360). Eisenberg does refer to Rabbi Akiva's intense prayer movements (Berachos 31a) which has indeed been given as one of those later sources which seek to give a Talmudic anchor for a custom, but I can't make out where the 8th century is supposed to come in. Maybe the implication is that the Talmud existed already in the 8th century?