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

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

[nongnu] elpa/subed 265ff5f7b8 1/2: Make subed-scale-subtitles and subed


From: ELPA Syncer
Subject: [nongnu] elpa/subed 265ff5f7b8 1/2: Make subed-scale-subtitles and subed-move-subtitles interactive
Date: Wed, 30 Nov 2022 15:00:01 -0500 (EST)

branch: elpa/subed
commit 265ff5f7b8a5a104b6c8edb05300c48609c8e7e9
Author: Sacha Chua <sacha@sachachua.com>
Commit: Sacha Chua <sacha@sachachua.com>

    Make subed-scale-subtitles and subed-move-subtitles interactive
    
    * subed/subed-common.el (subed--scale-subtitles-in-region): Mention
    subed-move-subtitles.
    (subed-scale-subtitles): Make interactive.Mention
    subed-move-subtitles.
    (subed-scale-subtitles-forward): Mention subed-move-subtitles.
    (subed-scale-subtitles-backward): Mention subed-move-subtitles.
    (subed-move-subtitles): Make interactive.
---
 NEWS.org              |  5 +++++
 README.org            |  9 +++++----
 subed/subed-common.el | 33 +++++++++++++++++++++++++++------
 subed/subed.el        |  2 +-
 4 files changed, 38 insertions(+), 11 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index f84274e536..5e9753ddcc 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,6 +1,11 @@
 #+OPTIONS: toc:nil
 
 * subed news
+** Version 1.0.25 - 2022-11-30 - Sacha Chua
+
+subed-move-subtitles and subed-scale-subtitles are now interactive
+commands. The documentation for subed-scale-subtitles now mentions
+subed-move-subtitles, and I've updated the README to mention them.
 
 ** Version 1.0.24 - 2022-11-18 - Sacha Chua
 
diff --git a/README.org b/README.org
index 8d89c4cdb6..8485de6b34 100644
--- a/README.org
+++ b/README.org
@@ -37,10 +37,11 @@ formats are:
 - Adjust subtitle start (~M-[~ / ~M-]~) and stop (~M-{~ / ~M-}~) time.  A
   prefix argument sets the number of milliseconds for the current session
   (e.g. ~C-u 1000 M-[ M-[ M-[~ decreases start time by 3 seconds).
-- Move the current subtitle or all marked subtitles forward (~C-M-n~) or
-  backward (~C-M-p~) in time without changing subtitle duration.  A prefix
-  argument sets the number of milliseconds for the current session (e.g. ~C-u
-  500 C-M-n C-M-n~ moves the current subtitle 1 second forward).
+- Move the current subtitle or all marked subtitles
+  (~subed-move-subtitles~) forward (~C-M-n~) or backward (~C-M-p~) in
+  time without changing subtitle duration.  A prefix argument sets the
+  number of milliseconds for the current session (e.g. ~C-u 500 C-M-n
+  C-M-n~ moves the current subtitle 1 second forward).
 - Shift the current subtitle forward (~C-M-f~) or backward (~C-M-b~) together
   with all following subtitles.  This is basically a convenience shortcut for
   ~C-SPC M-> C-M-n/p~.
diff --git a/subed/subed-common.el b/subed/subed-common.el
index 4899c48267..c7881d5e9e 100644
--- a/subed/subed-common.el
+++ b/subed/subed-common.el
@@ -773,8 +773,10 @@ but we move the start time first."
 
 (defun subed--scale-subtitles-in-region (msecs beg end)
   "Scale subtitles between BEG and END after moving END milliseconds.
-BEG and END specify a region."
-  (let* ((beg-point (save-excursion     ; normalized to fixed location over BEG
+BEG and END specify a region.  This stretches the subtitles so
+that they cover the new timespan.  If you want to shift all the
+subtitles by the same offset, use `subed-move-subtitles' instead."
+  (let* ((beg-point (save-excursion    ; normalized to fixed location over BEG
                       (goto-char beg)
                       (subed-jump-to-subtitle-end)
                       (point)))
@@ -893,8 +895,16 @@ BEG and END specify a region."
   "Scale subtitles between BEG and END after moving END MSECS.
 Use a negative MSECS value to move END backward.
 If END is nil, END will be the last subtitle in the buffer.
-If BEG is nil, BEG will be the first subtitle in the buffer."
-  (let ((beg (or beg (point-min)))
+If BEG is nil, BEG will be the first subtitle in the buffer.
+
+If you want to shift all the subtitles by the same offset, use
+`subed-move-subtitles' instead."
+       (interactive (list (if current-prefix-arg
+                                                                               
                 (prefix-numeric-value current-prefix-arg)
+                                                                               
         (read-number "Milliseconds: "))
+                                                                               
 (when (region-active-p) (point))
+                                                                               
 (when (region-active-p) (mark))))
+       (let ((beg (or beg (point-min)))
         (end (or end (point-max))))
     (subed--scale-subtitles-in-region msecs beg end)
     (when (subed-replay-adjusted-subtitle-p)
@@ -936,7 +946,10 @@ Extend region 100ms (the default) forward in time and 
scale subtitles in region.
 
 \\[subed-scale-subtitles-forward]
 Extend region another 100ms (the default) forward in time
-and scale subtitles again."
+and scale subtitles again.
+
+If you want to shift all the subtitles by the same offset, use
+`subed-move-subtitles' instead."
   (interactive "P")
   (let ((deactivate-mark nil)
         (msecs (subed-get-milliseconds-adjust arg))
@@ -947,7 +960,10 @@ and scale subtitles again."
 (defun subed-scale-subtitles-backward (&optional arg)
   "Scale subtitles after region is shortened `subed-milliseconds-adjust'.
 
-See `subed-scale-subtitles-forward' about ARG."
+See `subed-scale-subtitles-forward' about ARG.
+
+If you want to shift all the subtitles by the same offset, use
+`subed-move-subtitles' instead."
   (interactive "P")
   (let ((deactivate-mark nil)
         (msecs (* -1 (subed-get-milliseconds-adjust arg)))
@@ -962,6 +978,11 @@ 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
 replaying is enabled."
+       (interactive (list (if current-prefix-arg
+                                                                               
                 (prefix-numeric-value current-prefix-arg)
+                                                                               
         (read-number "Milliseconds: "))
+                                                                               
 (when (region-active-p) (point))
+                                                                               
 (when (region-active-p) (mark))))
   (cond ((and beg end) (subed--move-subtitles-in-region msecs beg end))
         (beg (subed--move-subtitles-in-region msecs beg (point-max)))
         (t (subed--move-current-subtitle msecs)))
diff --git a/subed/subed.el b/subed/subed.el
index 68ec73f3f3..307aa2438f 100644
--- a/subed/subed.el
+++ b/subed/subed.el
@@ -1,6 +1,6 @@
 ;;; subed.el --- A major mode for editing subtitles  -*- lexical-binding: t; 
-*-
 
-;; Version: 1.0.24
+;; Version: 1.0.25
 ;; Maintainer: Sacha Chua <sacha@sachachua.com>
 ;; Author: Random User
 ;; Keywords: convenience, files, hypermedia, multimedia



reply via email to

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