[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/subed 4e3e42f 044/389: subed-srt-sort: Wrap function body
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/subed 4e3e42f 044/389: subed-srt-sort: Wrap function body in atomic-change-group |
Date: |
Fri, 3 Dec 2021 10:59:53 -0500 (EST) |
branch: elpa/subed
commit 4e3e42fef75b679b3484dc1bf085b10289f2b58b
Author: Random User <rndusr@posteo.de>
Commit: Random User <rndusr@posteo.de>
subed-srt-sort: Wrap function body in atomic-change-group
---
subed/subed-srt.el | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/subed/subed-srt.el b/subed/subed-srt.el
index ae8e4e1..f186d14 100644
--- a/subed/subed-srt.el
+++ b/subed/subed-srt.el
@@ -495,19 +495,21 @@ each subtitle."
(defun subed-srt-sort ()
"Sanitize, then sort subtitles by start time and re-number them."
(interactive)
- (subed-srt-sanitize)
- (subed--save-excursion
- (goto-char (point-min))
- (sort-subr nil
- ;; nextrecfun (move to next record/subtitle or to end-of-buffer
- ;; if there are no more records)
- (lambda () (unless (subed-srt-forward-subtitle-id)
- (goto-char (point-max))))
- ;; endrecfun (move to end of current record/subtitle)
- 'subed-srt-move-to-subtitle-end
- ;; startkeyfun (return sort value of current record/subtitle)
- 'subed-srt--subtitle-msecs-start))
- (subed-srt--regenerate-ids))
+ (atomic-change-group
+ (subed-srt-validate)
+ (subed-srt-sanitize)
+ (subed--save-excursion
+ (goto-char (point-min))
+ (sort-subr nil
+ ;; nextrecfun (move to next record/subtitle or to end-of-buffer
+ ;; if there are no more records)
+ (lambda () (unless (subed-srt-forward-subtitle-id)
+ (goto-char (point-max))))
+ ;; endrecfun (move to end of current record/subtitle)
+ 'subed-srt-move-to-subtitle-end
+ ;; startkeyfun (return sort value of current record/subtitle)
+ 'subed-srt--subtitle-msecs-start))
+ (subed-srt-regenerate-ids)))
(provide 'subed-srt)
;;; subed-srt.el ends here
- [nongnu] elpa/subed 727275d 043/389: subed-srt-sanitize: Wrap function body in atomic-change-group, (continued)
- [nongnu] elpa/subed 727275d 043/389: subed-srt-sanitize: Wrap function body in atomic-change-group, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed a30a4b1 054/389: subed-srt-regenerate-ids: Don't change buffer unless it's necessary, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 5fd2009 055/389: subed-mpv: Handle invalid JSON, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed c865969 058/389: Toggle subed-mode when `subed-mode' is called, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 65bfba6 057/389: When enabling debugging, expect the debug window to exist, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed dc60c27 060/389: subed-srt--subtitle-id-at-msecs: Try to ignore invalid time stamps, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 0781285 061/389: Make mpv RPC socket and client buffer unique per buffer, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 2f86a8e 030/389: Add function: subed-srt--subtitle-text, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 17f3ae5 034/389: Add/fix tests for srt parsing changes, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed fb9354c 039/389: Adjust tests for subed-srt-move-to-subtitle-end, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 4e3e42f 044/389: subed-srt-sort: Wrap function body in atomic-change-group,
ELPA Syncer <=
- [nongnu] elpa/subed 33f27c5 063/389: Fix docstring, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 7932aee 066/389: subed-srt-sort: Sanitize before validating, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed dc771c8 067/389: Fix/Add tests, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 23156e3 071/389: subed-srt-subtitle-insert: Make argument optional, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 0e05076 072/389: subed-srt-sanitize: Properly trim trailing newlines, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 49e8e72 073/389: subed-srt-move-to-subtitle-end: Adjust docstring, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 473f041 077/389: Add ogv to video file extensions, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed bd4c44d 081/389: Fix typo, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed bd2c0e4 082/389: Add LICENSE, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 07c6b2b 083/389: Show more helpful error message if mpv isn't available, ELPA Syncer, 2021/12/03