branch: elpa/subed commit ec03689caf245e3b309ba0b3ece42742eb3f096e Author: Random User <rnd...@posteo.de> Commit: Random User <rnd...@posteo.de>
Fix subed--for-each-subtitle --- subed/subed.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/subed/subed.el b/subed/subed.el index 9980361..33d30a1 100644 --- a/subed/subed.el +++ b/subed/subed.el @@ -152,10 +152,13 @@ Before BODY is run, point is placed on the subtitle's ID." (save-excursion (goto-char ,beg) (subed-jump-to-subtitle-id) - (progn ,@body) - (while (and (<= (point) (or ,end (point-max))) - (subed-forward-subtitle-id)) - (progn ,@body)))))) + (catch 'last-subtitle-reached + (while t + (when (> (point) (or ,end (point-max))) + (throw 'last-subtitle-reached t)) + (progn ,@body) + (unless (subed-forward-subtitle-id) + (throw 'last-subtitle-reached t)))))))) (defun subed--right-pad (string length fillchar) "Use FILLCHAR to make STRING LENGTH characters long."