[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."
- [nongnu] elpa/subed 7710790 090/389: Add subed-move-subtitle-forward/backward, (continued)
- [nongnu] elpa/subed 7710790 090/389: Add subed-move-subtitle-forward/backward, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 3511026 091/389: Move utilities to the top, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 81aca87 008/389: Be more robust when moving forward/backward to subtitle text, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 8e4bd20 069/389: Fix indentation, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 6e525b9 079/389: Add screenshot, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed bf9ceeb 094/389: Reduce word count by 1, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 42199eb 095/389: Workaround for GitHub's lack of support for ~~/path/in/home~, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 5c51000 101/389: Call time-adjusted-hook functions with start time, not stop time, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 53d1e33 102/389: Fix error when adjusting start/stop time in empty buffer, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed a0cb0f1 108/389: Keep region active during subtitle movement, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 2c7554a 109/389: Wrap subed--for-each-subtitle in atomic-change-group,
ELPA Syncer <=
- [nongnu] elpa/subed e792e0f 122/389: Fix test description, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 489bbea 130/389: Remove subed-milliseconds-move, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed a7dda70 137/389: Add subtitle shifting to features, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed a819a93 139/389: Fix test description, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 06851d8 143/389: Prevent overlapping when adjusting subtitle start/stop time, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 651c6de 031/389: Wrap some function bodies in save-match-data, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 57c902a 068/389: subed-srt-sanitize: Don't change buffer unless it's necessary, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 1571de4 070/389: Use prefix arg to set start/stop time adjustment, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed f832a1d 075/389: Add more tests for subed-srt-move-to-subtitle-end, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 8374498 076/389: README: Split feature list and some rewording, ELPA Syncer, 2021/12/03