emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/subed ec03689 105/389: Fix subed--for-each-subtitle


From: ELPA Syncer
Subject: [nongnu] elpa/subed ec03689 105/389: Fix subed--for-each-subtitle
Date: Fri, 3 Dec 2021 11:00:06 -0500 (EST)

branch: elpa/subed
commit ec03689caf245e3b309ba0b3ece42742eb3f096e
Author: Random User <rndusr@posteo.de>
Commit: Random User <rndusr@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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]