branch: elpa/subed
commit 03cd2bf8862416b309bd0f435eceffe7873e2fd0
Author: Random User <rnd...@posteo.de>
Commit: Random User <rnd...@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