[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/subed 52ee2ac 006/389: Be more robust when getting subtitl
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/subed 52ee2ac 006/389: Be more robust when getting subtitle's relative point |
Date: |
Fri, 3 Dec 2021 10:59:46 -0500 (EST) |
branch: elpa/subed
commit 52ee2ac4f75ebcf90219be78b53dd3b9136b113e
Author: Random User <rndusr@posteo.de>
Commit: Random User <rndusr@posteo.de>
Be more robust when getting subtitle's relative point
---
subed/subed-srt.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/subed/subed-srt.el b/subed/subed-srt.el
index 9d98cc7..e45b997 100644
--- a/subed/subed-srt.el
+++ b/subed/subed-srt.el
@@ -107,11 +107,12 @@ after MSECS if there is one and its start time is >=
MSECS +
(subed-srt--timestamp-to-msecs timestamp))))
(defun subed-srt--subtitle-relative-point ()
- "Point relative to subtitle's ID, i.e. point within subtitle."
+ "Point relative to subtitle's ID or nil if ID can't be found."
(let ((start-point (save-excursion
- (progn (subed-srt-move-to-subtitle-id)
- (point)))))
- (- (point) start-point)))
+ (when (subed-srt-move-to-subtitle-id)
+ (point)))))
+ (when start-point
+ (- (point) start-point))))
;;; Traversing
- [nongnu] elpa/subed 73419ca 021/389: Make forward/backward movement tests pass, (continued)
- [nongnu] elpa/subed 73419ca 021/389: Make forward/backward movement tests pass, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 99a235a 019/389: Spoon trailing parens, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 46aeb10 020/389: Add more tests for forward/backward movement, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed fd7c2ba 017/389: Add tests for getting relative point within subtitle, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed ac4bc87 025/389: Add more tests for moving to subtitle ID, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 7d4caaa 018/389: Move time adjustment tests, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed f8a7c6a 029/389: Fix test that failed because of lexical scoping, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed b3f2776 032/389: Adjust some test descriptions and apply cosmetics, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 4b16d97 033/389: Trying to do more resilient srt parsing, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 63f0ef5 040/389: In general, subtitle separator must be two or more newlines, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 52ee2ac 006/389: Be more robust when getting subtitle's relative point,
ELPA Syncer <=
- [nongnu] elpa/subed 5131bc4 009/389: Add subed-srt-forward/backward-subtitle-end functions, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed c04670a 007/389: Adjust some docstrimgs, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed c5dcb73 010/389: Make closing parens spoon each other, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 8a39911 024/389: Use let instead of setq, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 78d3855 026/389: subed-srt-move-to-subtitle-id: Use let instead of setq, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed c895b91 012/389: Add test for sanitizing on empty subtitle texts, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 6797d10 028/389: Use lexical scoping, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 7939e0a 022/389: Move function to have same order as tests, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 31f8255 016/389: README: Turns out spaces are not the issue, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 27c8141 014/389: Some work on README, ELPA Syncer, 2021/12/03