[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/subed 3a0f267d58 2/5: Fix compiler warnings
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/subed 3a0f267d58 2/5: Fix compiler warnings |
Date: |
Fri, 13 Dec 2024 10:02:35 -0500 (EST) |
branch: elpa/subed
commit 3a0f267d582de6c9246ebe38823727ed2e7fb948
Author: Sacha Chua <sacha@sachachua.com>
Commit: Sacha Chua <sacha@sachachua.com>
Fix compiler warnings
---
subed/subed-common.el | 42 ++++++++++++++++++++++++------------------
subed/subed-config.el | 10 +++++-----
subed/subed-mpv.el | 2 ++
subed/subed-vtt.el | 21 ++++++++++-----------
subed/subed.el | 2 ++
5 files changed, 43 insertions(+), 34 deletions(-)
diff --git a/subed/subed-common.el b/subed/subed-common.el
index 7b131b2d12..50f642a7f5 100644
--- a/subed/subed-common.el
+++ b/subed/subed-common.el
@@ -33,6 +33,7 @@
(require 'subed-mpv)
(declare-function subed-tsv-mode "subed-tsv" ())
+(declare-function subed-guess-format "subed" (&optional filename))
;;; Generic functions and variables
@@ -102,8 +103,8 @@ subtitles) as long the subtitle IDs don't change."
;; exact original position
(condition-case nil
(forward-char sub-pos)
- ('beginning-of-buffer nil)
- ('end-of-buffer nil)))
+ (beginning-of-buffer nil)
+ (end-of-buffer nil)))
(goto-char pos)))))
(defmacro subed-for-each-subtitle (beg end reverse &rest body)
@@ -252,6 +253,7 @@ Return point or nil if a the subtitle's text can't be
found."
If SUB-ID is not given, use subtitle on point.
Return point or nil if a the subtitle's comment can't be found."
(interactive)
+ (ignore sub-id)
nil)
(subed-define-generic-function jump-to-subtitle-end (&optional sub-id)
@@ -425,10 +427,11 @@ If SUB-ID is not given, set the text of the current
subtitle."
"Return subtitle comment or nil if none."
nil)
-(subed-define-generic-function set-subtitle-comment (comment &optional _)
+(subed-define-generic-function set-subtitle-comment (comment)
"Set the current subtitle's comment to COMMENT.
If COMMENT is nil or the empty string, remove the comment."
(interactive "MComment: ")
+ (ignore comment)
(error "Not implemented"))
(subed-define-generic-function set-subtitle-time-start (msecs
@@ -439,14 +442,14 @@ If COMMENT is nil or the empty string, remove the
comment."
If SUB-ID is not given, set the start of the current subtitle.
-If `subed-enforce-time-boundaries' is set to 'adjust, adjust the
+If `subed-enforce-time-boundaries' is set to `adjust', adjust the
current subtitle's stop time to avoid negative durations (unless
-IGNORE-NEGATIVE-DURATION is non-nil) and adjust the previous
-subtitle's stop time to maintain `subed-subtitle-spacing' (unless
-IGNORE-OVERLAP is non-nil) if needed. If
-`subed-enforce-time-boundaries' is set to 'error, throw an error
-in those cases. If `subed-enforce-time-boundaries' is nil, make
-the changes without checking.
+IGNORE-NEGATIVE-DURATION is non-nil) and adjust the previous subtitle's
+stop time to maintain `subed-subtitle-spacing' (unless IGNORE-OVERLAP is
+non-nil) if needed. If `subed-enforce-time-boundaries' is set to
+`error', throw an error in those cases. If
+`subed-enforce-time-boundaries' is nil, make the changes without
+checking.
Return the new subtitle start time in milliseconds."
(save-excursion
@@ -516,12 +519,12 @@ Return the new subtitle start time in milliseconds."
If SUB-ID is not given, set the stop of the current subtitle.
-If `subed-enforce-time-boundaries' is set to 'adjust, adjust the
+If `subed-enforce-time-boundaries' is set to `adjust', adjust the
current subtitle's start time to avoid negative durations (unless
IGNORE-NEGATIVE-DURATION is non-nil) and adjust the next
subtitle's start time to maintain
`subed-subtitle-spacing' (unless IGNORE-OVERLAP is non-nil) if
-needed. If `subed-enforce-time-boundaries' is set to 'error,
+needed. If `subed-enforce-time-boundaries' is set to `error',
throw an error in those cases. If
`subed-enforce-time-boundaries' is nil, make the changes without
checking.
@@ -677,7 +680,8 @@ If BEG and END are not specified, use the whole buffer."
(defun subed-append-subtitle-list (subtitles)
"Append SUBTITLES.
-SUBTITLES should be a list with entries of the form (id start stop text
comment)."
+SUBTITLES should be a list with entries of the form (id start stop text
+ comment)."
(mapc (lambda (sub) (apply #'subed-append-subtitle sub)) subtitles))
(defun subed-subtitle-list-text (subtitles &optional include-comments)
@@ -1212,7 +1216,7 @@ or `subed-shift-subtitle-backward'."
(subed-mpv-jump (subed-subtitle-msecs-start)))))
(defun subed-move-subtitles-to-start-at-timestamp (timestamp &optional beg end)
- "Move subtitles between BEG and END so that the current subtitle starts at
TIMESTAMP.
+ "Move subtitles between BEG and END to start at TIMESTAMP.
If END is nil, move all subtitles from BEG to end of buffer.
If BEG is nil, move only the current subtitle.
After subtitles are moved, replay the first moved subtitle if
@@ -1272,7 +1276,8 @@ See `subed-move-subtitle-forward' about ARG."
(defun subed-shift-subtitles (&optional arg)
"Move this and following subtitles by ARG milliseconds.
-To shift to a specific timestamp, use
`subed-shift-subtitles-to-start-at-timestamp'."
+To shift to a specific timestamp, use
+`subed-shift-subtitles-to-start-at-timestamp'."
(interactive (list (if current-prefix-arg
(prefix-numeric-value current-prefix-arg)
(read-number "Milliseconds: "))))
@@ -1281,9 +1286,10 @@ To shift to a specific timestamp, use
`subed-shift-subtitles-to-start-at-timesta
(subed-move-subtitles msecs (point))))
(defun subed-shift-subtitles-to-start-at-timestamp (timestamp)
- "Move this and following subtitles so that the current one starts at
TIMESTAMP.
-To shift by a millisecond offset, use `subed-shift-subtitles'.
-If TIMESTAMP is a number or a numeric string, treat it as the time in
milliseconds."
+ "Move this and following subtitles to starts at TIMESTAMP.
+To shift by a millisecond offset, use `subed-shift-subtitles'. If
+TIMESTAMP is a number or a numeric string, treat it as the time in
+milliseconds."
(interactive (list (read-string "New start: ")))
(subed-shift-subtitles (- (subed-to-msecs timestamp)
(subed-subtitle-msecs-start))))
diff --git a/subed/subed-config.el b/subed/subed-config.el
index 2f3d8bd330..1397f04a1f 100644
--- a/subed/subed-config.el
+++ b/subed/subed-config.el
@@ -87,12 +87,12 @@
(defcustom subed-video-extensions '("mkv" "mp4" "webm" "avi" "ts" "ogv" "mov")
"Video file name extensions."
- :type 'list
+ :type '(repeat string)
:group 'subed)
(defcustom subed-audio-extensions '("wav" "ogg" "mp3" "opus" "m4a")
"Audio file name extensions."
- :type 'list
+ :type '(repeat string)
:group 'subed)
(define-obsolete-variable-alias 'subed-auto-find-video 'subed-auto-play-media
"1.20")
@@ -161,11 +161,11 @@ If set to zero or smaller, playback is paused."
(defcustom subed-enforce-time-boundaries 'adjust
"How to manage changes that cause overlapping subtitles or negative
durations.
-- 'adjust means adjust the stop or start time of the current subtitle to
+- `adjust' means adjust the stop or start time of the current subtitle to
keep duration >= 0, and adjust the previous or next subtitle as needed
to maintain `subed-subtitle-spacing'.
-- 'clip means limit the change to the maximum it can be within the boundaries.
-- 'error means report an error if there will be overlaps or negative duration.
+- `clip' means limit the change to the maximum it can be within the boundaries.
+- `error' means report an error if there will be overlaps or negative duration.
- nil means perform the change without checking.
Other values aside from the ones specified above will be treated as nil."
diff --git a/subed/subed-mpv.el b/subed/subed-mpv.el
index 604927bfa1..6d18f26acf 100644
--- a/subed/subed-mpv.el
+++ b/subed/subed-mpv.el
@@ -32,6 +32,8 @@
(declare-function subed-subtitle-id "subed-common" ())
(declare-function subed-subtitle-msecs-start "subed-common" (&optional id))
+(declare-function subed-subtitle-msecs-stop "subed-common" (&optional id))
+
(defvar subed-mpv-frame-step-map)
(defvar-local subed-mpv-is-playing nil
diff --git a/subed/subed-vtt.el b/subed/subed-vtt.el
index 35b0415a13..7ca819de58 100644
--- a/subed/subed-vtt.el
+++ b/subed/subed-vtt.el
@@ -327,17 +327,16 @@ TEXT defaults to an empty string.
Move point to the text of the inserted subtitle. Return new
point. Use the format-specific function for MAJOR-MODE."
- (let ((pos (point)))
- (unless (or (subed-forward-subtitle-comment) (subed-forward-subtitle-id))
- ;; Point is on last subtitle or buffer is empty
- (subed-jump-to-subtitle-end)
- (when (looking-at "[[:space:]]+")
- (replace-match ""))
- ;; Moved point to end of last subtitle; ensure separator exists
- (while (not (looking-at "\\(\\`\\|[[:blank:]]*\n[[:blank:]]*\n\\)"))
- (save-excursion (insert ?\n)))
- ;; Move to end of separator
- (goto-char (match-end 0))))
+ (unless (or (subed-forward-subtitle-comment) (subed-forward-subtitle-id))
+ ;; Point is on last subtitle or buffer is empty
+ (subed-jump-to-subtitle-end)
+ (when (looking-at "[[:space:]]+")
+ (replace-match ""))
+ ;; Moved point to end of last subtitle; ensure separator exists
+ (while (not (looking-at "\\(\\`\\|[[:blank:]]*\n[[:blank:]]*\n\\)"))
+ (save-excursion (insert ?\n)))
+ ;; Move to end of separator
+ (goto-char (match-end 0)))
(insert (subed-make-subtitle id start stop text comment))
(unless (eolp)
;; Complete separator with another newline unless we inserted at the end
diff --git a/subed/subed.el b/subed/subed.el
index 974ab09ef2..f750471ded 100644
--- a/subed/subed.el
+++ b/subed/subed.el
@@ -39,6 +39,8 @@
(require 'subed-common)
(require 'subed-mpv)
+(declare-function tramp-tramp-file-p "tramp")
+
(defconst subed-mpv-frame-step-map
(let ((map (make-sparse-keymap)))
(define-key map "." #'subed-mpv-frame-step)
- [nongnu] elpa/subed updated (a80297b9c1 -> 00d9568b27), ELPA Syncer, 2024/12/13
- [nongnu] elpa/subed 3a0f267d58 2/5: Fix compiler warnings,
ELPA Syncer <=
- [nongnu] elpa/subed 37a671b816 1/5: VTT: Require newlines before NOTE so that it can be within cue text, ELPA Syncer, 2024/12/13
- [nongnu] elpa/subed 00d9568b27 5/5: update README note, ELPA Syncer, 2024/12/13
- [nongnu] elpa/subed 545f170170 4/5: Show directories when doing subed-word-data-load-from-file, ELPA Syncer, 2024/12/13
- [nongnu] elpa/subed f9252af5bb 3/5: New subed-align-region, subed-retime-subtitles; move duration to subed-common, ELPA Syncer, 2024/12/13