[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/subed e8a68c2 322/389: subed-srt--msecs-to-timestamp: Expl
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/subed e8a68c2 322/389: subed-srt--msecs-to-timestamp: Explain save-match-data |
Date: |
Fri, 3 Dec 2021 11:00:50 -0500 (EST) |
branch: elpa/subed
commit e8a68c25aa012a5403eb8150453e5db3912ae649
Author: Random User <rndusr@posteo.de>
Commit: Random User <rndusr@posteo.de>
subed-srt--msecs-to-timestamp: Explain save-match-data
---
subed/subed-srt.el | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/subed/subed-srt.el b/subed/subed-srt.el
index 6c86163..6ef5c3d 100644
--- a/subed/subed-srt.el
+++ b/subed/subed-srt.el
@@ -59,9 +59,10 @@ Return nil if TIME-STRING doesn't match the pattern."
(defun subed-srt--msecs-to-timestamp (msecs)
"Convert MSECS to string in the format HH:MM:SS,MS."
- (save-match-data
- (concat (format-seconds "%02h:%02m:%02s" (/ msecs 1000))
- "," (format "%03d" (mod msecs 1000)))))
+ ;; We need to wrap format-seconds in save-match-data because it does regexp
+ ;; stuff and we need to preserve our own match-data.
+ (concat (save-match-data (format-seconds "%02h:%02m:%02s" (/ msecs 1000)))
+ "," (format "%03d" (mod msecs 1000))))
(defun subed-srt--subtitle-id ()
"Return the ID of the subtitle at point or nil if there is no ID."
- [nongnu] elpa/subed 66889a1 311/389: Fix test: Renumbering does not modify the kill-ring, (continued)
- [nongnu] elpa/subed 66889a1 311/389: Fix test: Renumbering does not modify the kill-ring, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed e1fd29b 312/389: subed-srt--regenerate-ids: Do not modify empty buffer, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed ca015d4 313/389: Fix one compile warning, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 317c411 314/389: Remove declarations, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 72020af 315/389: Use long options, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed be43268 316/389: Fix test-compile target, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 3753706 318/389: Fix warning about missing function: subed-mpv--sub-add-after-save, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 473fbc2 319/389: subed-srt--subtitle-text: Improve docstring, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 05ba952 320/389: Only add subtitles file if subed-subtitle-id returns non-nil, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed ea11119 321/389: Inform compiler about unused variables to prevent warnings, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed e8a68c2 322/389: subed-srt--msecs-to-timestamp: Explain save-match-data,
ELPA Syncer <=
- [nongnu] elpa/subed 5c39418 323/389: Copy subed-srt--msecs-to-timestamp to subed-common.el, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed ecfec2b 325/389: Move debugging functions to subed-debug.el, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed f69f769 327/389: Set subed-mode-map in subed.el, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed d110f79 329/389: Stop disabling point-to-player sync on file-loaded event, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed dd4dc8c 332/389: Automatically disable point-to-player sync while looping, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 5957cbe 333/389: Set default subed-loop-seconds-after/before to 1, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed e71a64b 339/389: Refactor common code into subed-mpv-play-video, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed daaf480 340/389: subed-vtt: Fix navigation code, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 9642945 346/389: Further fixes to let tests pass, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 0968590 344/389: Fix separator search in subed-srt--validate, ELPA Syncer, 2021/12/03