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

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

[nongnu] elpa/subed 489bbea 130/389: Remove subed-milliseconds-move


From: ELPA Syncer
Subject: [nongnu] elpa/subed 489bbea 130/389: Remove subed-milliseconds-move
Date: Fri, 3 Dec 2021 11:00:11 -0500 (EST)

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

    Remove subed-milliseconds-move
    
    Use subed-milliseconds-adjust for adjusting and moving (and shifting in the
    future).
---
 subed/subed-config.el | 30 +++++-------------------------
 subed/subed.el        | 24 ++++++++++++------------
 2 files changed, 17 insertions(+), 37 deletions(-)

diff --git a/subed/subed-config.el b/subed/subed-config.el
index fc1cedd..275b7e3 100644
--- a/subed/subed-config.el
+++ b/subed/subed-config.el
@@ -112,12 +112,12 @@ The first existing file is then passed to 
`subed-open-video'."
 
 (defcustom subed-milliseconds-adjust 100
   "Number of milliseconds to add/subtract to subtitle start/stop
-time with `subed-increase-start-time',
-`subed-decrease-start-time', `subed-increase-stop-time' and
-`subed-decrease-stop-time'.
+times when adjust, moving or shifting subtitles.
 
-This variable is set if these functions are called with a prefix
-argument.  See `subed-increase-start-time'."
+This variable is set if the functions that use this variable are
+called with a prefix argument.  That makes the value of this
+variable persistent for the duration of the sessio.  Use
+`setq-default' to change the default value."
   :type 'float
   :group 'subed)
 
@@ -131,26 +131,6 @@ default.  Return (new) `subed-milliseconds-adjust' value."
          (custom-reevaluate-setting 'subed-milliseconds-adjust)))  ;; Reset to 
default
   subed-milliseconds-adjust)
 
-(defcustom subed-milliseconds-move 100
-  "Number of milliseconds to provide to
-`subed-move-subtitle-forward' and `subed-move-subtitle-backward'
-by default.
-
-This variable is set if these functions are called with a prefix
-argument.  See `subed-move-subtitle-forward'."
-  :type 'float
-  :group 'subed)
-
-(defun subed--get-milliseconds-move (arg)
-  "Set `subed-milliseconds-move' to `arg' if it's a number.  If `arg'
-is non-nil, reset `subed-milliseconds-move' to its default.
-Return (new) `subed-milliseconds-move' value."
-  (cond ((integerp arg)
-          (setq subed-milliseconds-move arg))                    ;; Custom 
movement
-        ((not (eq nil arg))
-         (custom-reevaluate-setting 'subed-milliseconds-move)))  ;; Reset to 
default
-  subed-milliseconds-move)
-
 
 (defcustom subed-playback-speed-while-typing 0.3
   "Video playback speed while the user is editing the buffer.  If
diff --git a/subed/subed.el b/subed/subed.el
index 5f55603..68bda13 100644
--- a/subed/subed.el
+++ b/subed/subed.el
@@ -176,17 +176,17 @@ Before BODY is run, point is placed on the subtitle's ID."
 ;;; Moving subtitles
 
 (defun subed-move-subtitle-forward (&optional arg)
-  "Move subtitle `subed-milliseconds-move' forward in time while
-preserving its duration, i.e. increase start and stop time by the
-same amount.
+  "Move subtitle `subed-milliseconds-adjust' forward in time
+while preserving its duration, i.e. increase start and stop time
+by the same amount.
 
 If the region is active, all subtitles that are fully or
 partially in it are moved.
 
-The first step is to set `subed-milliseconds-move' to the value of the
-prefix argument if it is provided and if it is a number.  If the
-prefix argument is provided but not numerical,
-`subed-milliseconds-move' is reset to its default value.
+The first step is to set `subed-milliseconds-adjust' to the value
+of the prefix argument if it is provided and if it is a number.
+If the prefix argument is provided but not numerical,
+`subed-milliseconds-adjust' is reset to its default value.
 
 Example usage:
   \\[universal-argument] 1000 \\[subed-move-subtitle-forward]  Move subtitle 
1000ms forward in time
@@ -197,7 +197,7 @@ Example usage:
            \\[subed-move-subtitle-forward]  Move subtitle 100ms (the default) 
forward in time again"
   (interactive "P")
   (let ((deactivate-mark nil)
-        (msecs (subed--get-milliseconds-move arg))
+        (msecs (subed--get-milliseconds-adjust arg))
         (beg (when (use-region-p) (region-beginning)))
         (end (when (use-region-p) (region-end))))
     (subed--with-subtitle-replay-disabled
@@ -210,14 +210,14 @@ Example usage:
         (subed-mpv-jump (subed--subtitle-msecs-start))))))
 
 (defun subed-move-subtitle-backward (&optional arg)
-  "Move subtitle `subed-milliseconds-move' backward in time while
-preserving its duration, i.e. decrease start and stop time by the
-same amount.
+  "Move subtitle `subed-milliseconds-adjust' backward in time
+while preserving its duration, i.e. decrease start and stop time
+by the same amount.
 
 See `subed-move-subtitle-forward'."
   (interactive "P" (if (use-region-p) (list (region-beginning) (region-end))))
   (let ((deactivate-mark nil)
-        (msecs (* -1 (subed--get-milliseconds-move arg)))
+        (msecs (* -1 (subed--get-milliseconds-adjust arg)))
         (beg (when (use-region-p) (region-beginning)))
         (end (when (use-region-p) (region-end))))
     (subed--with-subtitle-replay-disabled



reply via email to

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