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

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

[nongnu] elpa/subed 2709ca293b 4/9: subed-subtitles-sorted-hook: New hoo


From: ELPA Syncer
Subject: [nongnu] elpa/subed 2709ca293b 4/9: subed-subtitles-sorted-hook: New hook.
Date: Tue, 28 Nov 2023 19:00:27 -0500 (EST)

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

    subed-subtitles-sorted-hook: New hook.
    
    This should make it easier to regenerate waveforms after sorting.
    
    * subed/subed-config.el (subed-subtitles-sorted-hook): New hook.
    * subed/subed-common.el (sort): Call subed-subtitles-sorted-hook.
---
 subed/subed-common.el | 3 ++-
 subed/subed-config.el | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/subed/subed-common.el b/subed/subed-common.el
index 23d545a558..3124d1889a 100644
--- a/subed/subed-common.el
+++ b/subed/subed-common.el
@@ -2236,7 +2236,8 @@ If LIST is nil, use the subtitles in the current buffer."
                     #'subed-jump-to-subtitle-end
                     ;; startkeyfun (return sort value of current 
record/subtitle)
                     #'subed-subtitle-msecs-start))
-        (subed-regenerate-ids)))))
+        (subed-regenerate-ids)
+        (run-hooks 'subed-subtitles-sorted-hook)))))
 
 ;;; Conversion
 
diff --git a/subed/subed-config.el b/subed/subed-config.el
index 04fbee69ef..7ffbdf2e21 100644
--- a/subed/subed-config.el
+++ b/subed/subed-config.el
@@ -308,6 +308,8 @@ The functions are called with the subtitle's start time."
 (defvar-local subed-subtitle-motion-hook nil
   "Functions to call after current subtitle changed.")
 
+(defvar-local subed-subtitles-sorted-hook nil
+  "Functions to call after subtitles are sorted.")
 
 (provide 'subed-config)
 ;;; subed-config.el ends here



reply via email to

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