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

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

[nongnu] elpa/subed 205d3c8 135/389: Add subed-shift-subtitle-forward/ba


From: ELPA Syncer
Subject: [nongnu] elpa/subed 205d3c8 135/389: Add subed-shift-subtitle-forward/backward
Date: Fri, 3 Dec 2021 11:00:12 -0500 (EST)

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

    Add subed-shift-subtitle-forward/backward
---
 subed/subed.el | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/subed/subed.el b/subed/subed.el
index efeda0b..6601985 100644
--- a/subed/subed.el
+++ b/subed/subed.el
@@ -232,6 +232,28 @@ See `subed-move-subtitle-forward'."
     (subed-move-subtitles msecs beg end)))
 
 
+;;; Shifting subtitles
+;;; (same as moving, but follow-up subtitles are also moved)
+
+(defun subed-shift-subtitle-forward (&optional arg)
+  "Shifting subtitles is like moving them, but it always moves
+the subtitles between point and the end of the buffer."
+  (interactive "P")
+  (let ((deactivate-mark nil)
+        (msecs (subed--get-milliseconds-adjust arg))
+        (beg (if (use-region-p) (region-beginning) (point))))
+    (subed-move-subtitles msecs beg)))
+
+(defun subed-shift-subtitle-backward (&optional arg)
+  "Shifting subtitles is like moving them, but it always moves
+the subtitles between point and the end of the buffer."
+  (interactive "P")
+  (let ((deactivate-mark nil)
+        (msecs (* -1 (subed--get-milliseconds-adjust arg)))
+        (beg (if (use-region-p) (region-beginning) (point))))
+    (subed-move-subtitles msecs beg)))
+
+
 ;;; Replay time-adjusted subtitle
 (defun subed-replay-adjusted-subtitle-p ()
   "Whether adjusting a subtitle's start/stop time causes the



reply via email to

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