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

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

[nongnu] elpa/subed 2c7554a 109/389: Wrap subed--for-each-subtitle in at


From: ELPA Syncer
Subject: [nongnu] elpa/subed 2c7554a 109/389: Wrap subed--for-each-subtitle in atomic-change-group
Date: Fri, 3 Dec 2021 11:00:07 -0500 (EST)

branch: elpa/subed
commit 2c7554af1dd2c763f80bb8092c29d436e98ab1c1
Author: Random User <rndusr@posteo.de>
Commit: Random User <rndusr@posteo.de>

    Wrap subed--for-each-subtitle in atomic-change-group
---
 subed/subed.el | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/subed/subed.el b/subed/subed.el
index aa27f78..ae63092 100644
--- a/subed/subed.el
+++ b/subed/subed.el
@@ -143,22 +143,23 @@ If END is nil, it defaults to `point-max'.
 If BEG and END are both nil, run BODY only on the subtitle at point.
 Before BODY is run, point is placed on the subtitle's ID."
   (declare (indent defun))
-  `(if (not ,beg)
-       ;; Run body on subtitle at point
-       (progn (save-excursion (subed-jump-to-subtitle-id)
-                              ,@body))
-     (progn
-       ;; Run body on multiple subtitles
-       (save-excursion
-         (goto-char ,beg)
-         (subed-jump-to-subtitle-id)
-         (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))))))))
+  `(atomic-change-group
+     (if (not ,beg)
+         ;; Run body on subtitle at point
+         (progn (save-excursion (subed-jump-to-subtitle-id)
+                                ,@body))
+       (progn
+         ;; Run body on multiple subtitles
+         (save-excursion
+           (goto-char ,beg)
+           (subed-jump-to-subtitle-id)
+           (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]