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

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

[nongnu] elpa/subed 37bd5f7 168/389: Don't provide sub-id to subtitle-ti


From: ELPA Syncer
Subject: [nongnu] elpa/subed 37bd5f7 168/389: Don't provide sub-id to subtitle-time-adjusted-hook functions
Date: Fri, 3 Dec 2021 11:00:19 -0500 (EST)

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

    Don't provide sub-id to subtitle-time-adjusted-hook functions
---
 subed/subed-config.el   |  8 +++-----
 subed/subed.el          |  5 ++---
 tests/test-subed-srt.el | 13 +++++++------
 3 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/subed/subed-config.el b/subed/subed-config.el
index 7deb9d0..49041cb 100644
--- a/subed/subed-config.el
+++ b/subed/subed-config.el
@@ -221,15 +221,13 @@ hardcoded."
 
 (defvar subed-subtitle-time-adjusted-hook ()
   "Functions to call when a subtitle's start or stop time has changed.
-The functions are called with the relevant subtitle ID and the
-subtitle's start time.")
+The functions are called with the subtitle's start time.")
 
 (defun subed--run-subtitle-time-adjusted-hook ()
-  "Run `subed-subtitle-time-adjusted-hook' functions with
-subtitle ID and start time of the adjusted subtitle."
+  "Run `subed-subtitle-time-adjusted-hook' functions.
+The functions are called with the subtitle's start time."
   (when subed-subtitle-time-adjusted-hook
     (run-hook-with-args 'subed-subtitle-time-adjusted-hook
-                        (subed-subtitle-id)
                         (subed-subtitle-msecs-start))))
 
 (defvar-local subed-point-motion-hook nil
diff --git a/subed/subed.el b/subed/subed.el
index 9a9f120..39aa7ae 100644
--- a/subed/subed.el
+++ b/subed/subed.el
@@ -342,9 +342,8 @@ start/stop time is adjusted."
       (subed-disable-replay-adjusted-subtitle)
     (subed-enable-replay-adjusted-subtitle)))
 
-(defun subed--replay-adjusted-subtitle (sub-id msecs-start)
-  "Seek player to start time of current subtitle or first
-subtitle in region if region is active."
+(defun subed--replay-adjusted-subtitle (msecs-start)
+  "Seek player to MSECS-START."
   (subed-debug "Replaying subtitle at: %s" (subed-srt--msecs-to-timestamp 
msecs-start))
   (subed-mpv-jump msecs-start))
 
diff --git a/tests/test-subed-srt.el b/tests/test-subed-srt.el
index 056628c..dac451b 100644
--- a/tests/test-subed-srt.el
+++ b/tests/test-subed-srt.el
@@ -606,26 +606,27 @@ Baz.
 (describe "Adjusting subtitle start/stop time"
           :var (subed-subtitle-time-adjusted-hook)
           (it "runs the appropriate hook."
-              (let ((foo (setf (symbol-function 'foo) (lambda (sub-id msecs) 
()))))
+              (let ((foo (setf (symbol-function 'foo) (lambda (msecs) ()))))
                 (spy-on 'foo)
                 (add-hook 'subed-subtitle-time-adjusted-hook 'foo)
                 (with-temp-buffer
                   (insert mock-srt-data)
                   (expect (subed-increase-start-time) :to-equal 100)
-                  (expect 'foo :to-have-been-called-with 3 183550)
+                  (expect 'foo :to-have-been-called-with 183550)
                   (expect 'foo :to-have-been-called-times 1)
                   (subed-srt--jump-to-subtitle-id 1)
                   (expect (subed-increase-stop-time) :to-equal 100)
-                  (expect 'foo :to-have-been-called-with 1 61000)
+                  (expect 'foo :to-have-been-called-with 61000)
                   (expect 'foo :to-have-been-called-times 2)
                   (subed-srt--jump-to-subtitle-end 2)
                   (expect (subed-decrease-start-time) :to-equal -100)
-                  (expect 'foo :to-have-been-called-with 2 122134)
+                  (expect 'foo :to-have-been-called-with 122134)
                   (expect 'foo :to-have-been-called-times 3)
                   (subed-srt--jump-to-subtitle-text 3)
                   (expect (subed-decrease-stop-time) :to-equal -100)
-                  (expect 'foo :to-have-been-called-with 3 183550)
-                  (expect 'foo :to-have-been-called-times 4))))
+                  (expect 'foo :to-have-been-called-with 183550)
+                  (expect 'foo :to-have-been-called-times 4))
+                (remove-hook 'subed-subtitle-time-adjusted-hook 'foo)))
           (it "adjusts the start/stop time."
               (with-temp-buffer
                 (insert mock-srt-data)



reply via email to

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