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

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

[nongnu] elpa/subed 03cd2bf 097/389: Wrap msecs-to-timestamp in save-mat


From: ELPA Syncer
Subject: [nongnu] elpa/subed 03cd2bf 097/389: Wrap msecs-to-timestamp in save-match-data
Date: Fri, 3 Dec 2021 11:00:05 -0500 (EST)

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

    Wrap msecs-to-timestamp in save-match-data
    
    Either format-seconds or format seem to alter match-data.
---
 subed/subed-srt.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/subed/subed-srt.el b/subed/subed-srt.el
index 47ec9ff..841a508 100644
--- a/subed/subed-srt.el
+++ b/subed/subed-srt.el
@@ -56,8 +56,9 @@ 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."
-  (concat (format-seconds "%02h:%02m:%02s" (/ msecs 1000))
-          "," (format "%03d" (mod msecs 1000))))
+  (save-match-data
+    (concat (format-seconds "%02h:%02m:%02s" (/ msecs 1000))
+            "," (format "%03d" (mod msecs 1000)))))
 
 (defun subed-srt--subtitle-id ()
   "Return the ID of subtitle at point or nil if there is no ID."



reply via email to

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