branch: elpa/subed
commit 46d5d1dd6b334bd86cc4aac767791690f7a63a89
Author: Sacha Chua <[email protected]>
Commit: Sacha Chua <[email protected]>

    subed-convert: Allow people to convert plain text files to subtitles
    
    * subed/subed-common.el (subed-convert): Convert
    plain text files to subtitles.
---
 subed/subed-common.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/subed/subed-common.el b/subed/subed-common.el
index 3e5b4b742a3..87e2df8c22b 100644
--- a/subed/subed-common.el
+++ b/subed/subed-common.el
@@ -2402,7 +2402,11 @@ prefix argument, include comments in TXT output."
                      current-prefix-arg))
   (let* ((subtitles
           (mapcar (lambda (sub) (cons nil (cdr sub))) ; remove ID
-                  (subed-subtitle-list)))
+                  (if (derived-mode-p 'subed-mode)
+                      (subed-subtitle-list)
+                    (mapcar (lambda (o)
+                              (list nil 0 0 o nil))
+                            (split-string (buffer-string) "\n\n")))))
          (new-filename (concat (file-name-base (or (buffer-file-name) 
(buffer-name))) "."
                                (downcase format)))
          (mode-func (pcase format

Reply via email to