branch: elpa/subed commit 381ed1e4c3bed51ae9a88fdc53677d3a9d8c148d Author: Random User <rnd...@posteo.de> Commit: Random User <rnd...@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