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

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

[nongnu] elpa/subed 381ed1e 159/389: Add subed-srt--max-subtitle-id


From: ELPA Syncer
Subject: [nongnu] elpa/subed 381ed1e 159/389: Add subed-srt--max-subtitle-id
Date: Fri, 3 Dec 2021 11:00:17 -0500 (EST)

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

    Add subed-srt--max-subtitle-id
---
 subed/subed-srt.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/subed/subed-srt.el b/subed/subed-srt.el
index 1befbd6..2aa46b1 100644
--- a/subed/subed-srt.el
+++ b/subed/subed-srt.el
@@ -63,6 +63,12 @@ Return nil if TIME-STRING doesn't match the pattern."
     (when (subed-srt--jump-to-subtitle-id)
       (string-to-number (current-word)))))
 
+(defun subed-srt--max-subtitle-id ()
+  "Return the ID of the last subtitle or nil if there are no subtitles."
+  (save-excursion
+    (goto-char (point-max))
+    (subed-srt--subtitle-id)))
+
 (defun subed-srt--subtitle-id-at-msecs (msecs)
   "Return the ID of the subtitle at MSECS milliseconds.
 If MSECS is between subtitles, return the subtitle that starts



reply via email to

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