[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)
- [nongnu] elpa/subed 06a4681 153/389: Adjusting functions return milliseconds moved, (continued)
- [nongnu] elpa/subed 06a4681 153/389: Adjusting functions return milliseconds moved, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed c7d3fcb 156/389: Add autoloading, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 20c70e8 160/389: Make more functions public, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed af2004c 172/389: subed-mode-enable: Add autoload cookie, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed a5d750d 162/389: Inser empty line after section header comment, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed e22f4b7 157/389: Make subed-srt-* functions private, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 3af0bb2 169/389: subed-guess-video-file: Don't croak if buffer-file-name returns nil, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed e195756 179/389: Rewrite adjusting tests, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 3e818aa 173/389: Remove useless (progn ...) in (if ...), ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 4116ea7 171/389: Add Makefile, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 37bd5f7 168/389: Don't provide sub-id to subtitle-time-adjusted-hook functions,
ELPA Syncer <=
- [nongnu] elpa/subed 3289584 170/389: Pacify checkdoc, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 645efb2 175/389: Don't test for undefined return value when moving subtitles, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 908b1b0 176/389: Simplify tests for moving in active region, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed c1c707e 182/389: Rename subed-adjust-to-player-start/stop-timestamp, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed f6b13f6 197/389: Adjust error message when autoloading video fails, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed e9f3e4e 215/389: Move tests for killing SRT subtitles to test-subed-srt.el, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 5b64bcc 203/389: Fix typo in docstring, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 619b170 177/389: subed-for-each-subtitle: Add reverse argument, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed b94330f 214/389: Fix indentations, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed afbdd42 206/389: Enable buttercup-minor-mode when opening test files, ELPA Syncer, 2021/12/03