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

[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



reply via email to

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