According to this, the explanation of the words of our teachers, the authors of the Shulchan Aruch, is as follows: That one who accepts a fast in a literal sense—it is obvious that he must fast until the emergence of the stars, for such is the opinion of most posikim, even according to our teacher, the Rema, as I wrote in section 11. However, the fasts that are accepted and established by force of custom, such as the Ten Days of Repentance, or some days of them if they are only accustomed to fast on them consistently, such as those who fast on the first day of Selichot or the eve of Rosh Hashanah, which are without acceptance—granted that they are called a "fast" regarding the matter of "Aneinu," nevertheless, one does not need completion until the emergence of the stars; rather, it is sufficient until sunset or until after the evening prayer. For since there is a limit to this, that previously it was forbidden to eat—it is called a "fast." And so too a groom on his wedding day, who must fast until after the chuppah and that is his limit, and therefore he shall pray "Aneinu" before the chuppah, and then he may drink from the cup of blessing. But those who fast from the seventeenth of Tammuz until the ninth of Av—even without acceptance they must complete until the emergence of the stars, since their fast is over the destruction, it is automatically like the seventeenth of Tammuz and the ninth of Av. And so too during the Ten Days of Repentance, those who do not always fast equally, only a day or two, and not with a fixed schedule for this day or these two days, but rather once this day and once that day—it is obvious that it requires acceptance and completion. And if he accepted a fast without specification—he must complete until the emergence of the stars. However, if he made a condition at the time of accepting the fast not to complete—it is obvious that the authority is in his hand, and he does not need to complete. (This is the explanation of the words of the Shulchan Aruch. And so it appears that the Taz and the Magen Avraham understood, except that they were brief in the essence of the matters. And the words of the Bach in this matter require great study, see there. And the Rema, even though in the previous section he wrote that we are accustomed even in a complete fast not to fast until the emergence of the stars, yet here there is a novelty that even until sunset is not required, but rather until some limit, such as during the Ten Days of Repentance until after the evening prayer, and the groom until after the chuppah, and similar to this. And that which the Magen Avraham explained in subsection 6, and the Taz in subsection 3, to distinguish between the Ten Days of Repentance and between the straits [Bein HaMetzarim], because the Ten Days of Repentance the fast is for the future, and between the straits it is for the past over the destruction—it is a difficult concept. And their words are from the Terumat HaDeshen, and the Bach complained about this, and raised a powerful difficulty from that of Rabbi Eliezer son of Rabbi Tzadok who did not complete, and he fasted for the past. And the Taz and the Magen Avraham were pressed to answer, see there. But according to what I wrote this is not the essence, and it is merely an example. And the main reason is that since they are between the seventeenth of Tammuz and the ninth of Av, and the fast has one intention for them over the destruction—if so, it follows automatically that they complete until the emergence of the stars like they themselves. Which is not the case in that of Rabbi Eliezer son of Rabbi Tzadok, for on the ninth of Av itself he would not complete. And according to this, there is no starting point for the difficulty of the Bach. The general rule of the matter: all types of fasts that are without acceptance—one does not need to complete until the emergence of the stars, but rather until some limit. And so too those who fast from Rosh Chodesh Elul. Except for between the straits, for the reason we explained with the help of Heaven. And be precise and you will find it easy.)
ולפי זה ביאור הדברים של רבותינו בעלי השולחן ערוך כן הוא: דמי שמקבל תענית ממש – פשיטא שצריך להתענות עד צאת הכוכבים, שכן הוא דעת רוב הפוסקים, אפילו לרבינו הרמ"א, כמו שכתבתי בסעיף יא. אך התעניתים שמקובלים ועומדים מכח המנהג, כמו עשרת ימי תשובה, או מקצת ימים מהם אם רק נוהגים להתענות בו בתמידיות, כמו המתענים יום ראשון של סליחות או ערב ראש השנה, שהם בלי קבלה – נהי דנקראים "תענית" לעניין "ענינו", מכל מקום אינו צריך השלמה עד צאת הכוכבים, אלא דיו עד השקיעה או עד אחר תפילת ערבית. דכיון שיש גבול לזה, שמקודם אסור לאכול – מקרי "תענית". וכן חתן ביום חופתו, שצריך להתענות עד אחר החופה וזהו גבולו, ולכן יתפלל "ענינו" קודם החופה, ואז יכול לשתות מכוס של ברכה. אבל המתענים מן שבעה עשר בתמוז עד תשעה באב – אף בלא קבלה צריכים להשלים עד צאת הכוכבים, כיון דתעניתם הוא על החורבן, ממילא דהוי כמו שבעה עשר בתמוז ותשעה באב. וכן בעשרת ימי תשובה אותם שאין מתענין תמיד בשוה, רק יום או יומים, ולא בקביעות יום זה או שני ימים אלו, אלא פעם יום זה ופעם יום זה – פשיטא דבעי קבלה והשלמה. ואם קבל תענית סתם – צריך להשלים עד צאת הכוכבים. אמנם אם התנה בשעת קבלת התענית שלא להשלים – פשיטא שהרשות בידו, ואינו צריך להשלים. (זהו ביאור דברי השולחן ערוך. וכן נראה שתפסו הט"ז והמגן אברהם, אלא שקיצרו בעיקר הדברים. ודברי הב"ח בזה צריכים עיון גדול, עיין שם. והרמ"א אף על גב דבסעיף הקודם כתב דנוהגין גם בתענית גמור שלא להתענות עד צאת הכוכבים, אך בכאן יש רבותא דאפילו עד השקיעה אינו צריך, אלא עד איזה גבול, כגון בעשרת ימי תשובה עד אחר תפילת ערבית, והחתן עד אחר החופה, וכיוצא בזה. ומה שהסבירו המגן אברהם בסעיף קטן ו, והט"ז בסעיף קטן ג, לחלק בין עשרת ימי תשובה ובין בין המצרים, משום דעשרת ימי תשובה התענית על העתיד, ובין המצרים על העבר על החורבן – היא קשה הציור. ודבריהם הם מתרומת הדשן, והב"ח התמרמר על זה, והקשה קושיא עצומה מהך דרבי אליעזר ברבי צדוק שלא השלים, והוא התענה על העבר. והט"ז והמגן אברהם נדחקו לתרץ, עיין שם. אבל לפי מה שכתבתי אין זה העיקר, ודוגמא בעלמא הוא. ועיקר הטעם דכיון שהם בין שבעה עשר בתמוז לתשעה באב, והתענית כוונה אחת להם על החורבן – אם כן ממילא דמשלימין עד צאת הכוכבים כמו הם עצמן. מה שאין כן בהך דרבי אליעזר ברבי צדוק, שבתשעה באב גופה לא היה משלים. ולפי זה אין שום התחלה לקושית הב"ח. כללא דמילתא: כל מיני תעניתים שבלא קבלה – אינו צריך להשלים עד צאת הכוכבים, אלא עד איזה גבול. וכן המתענים מראש חודש אלול. ולבד בין המצרים, מטעם שבארנו בסייעתא דשמיא. ודייק ותמצא קל.)