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

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

[nongnu] elpa/subed ba0e4635ee: subed-parse-file improvements: check fil


From: ELPA Syncer
Subject: [nongnu] elpa/subed ba0e4635ee: subed-parse-file improvements: check filename, don't autoplay media
Date: Thu, 22 Dec 2022 17:59:41 -0500 (EST)

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

    subed-parse-file improvements: check filename, don't autoplay media
    
    * subed/subed-common.el (subed-parse-file): Check filename, don't
    autoplay media.
---
 NEWS.org              |  5 +++++
 subed/subed-common.el | 25 +++++++++++++------------
 subed/subed.el        |  2 +-
 3 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index d1145ba20f..c3c22de221 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,6 +1,11 @@
 #+OPTIONS: toc:nil
 
 * subed news
+** Version 1.0.28 - 2022-12-22 - Sacha Chua
+
+subed-parse-file should handle nil filenames now. Also, it should not
+try to autoplay media.
+
 ** Version 1.0.27 - 2022-12-16 - Sacha Chua
 
 Bugfix: Actually include VTT comments when inserting subtitles
diff --git a/subed/subed-common.el b/subed/subed-common.el
index 1a0d8e7b51..189799bfe4 100644
--- a/subed/subed-common.el
+++ b/subed/subed-common.el
@@ -425,19 +425,20 @@ Return new point."
   "Return the subtitles from FILENAME in a list.
 If MODE-FUNC is non-nil, use that function to initialize the mode.
 Otherwise, initialize the mode based on the filename."
-  (when (file-exists-p filename)
+  (when (and filename (file-exists-p filename))
     (with-temp-buffer
-      (insert-file-contents filename)
-      (if mode-func
-          (funcall mode-func)
-        (let ((mode-entry
-               (seq-find (lambda (mode-alist)
-                           (string-match (car mode-alist) filename))
-                         auto-mode-alist)))
-          (if mode-entry
-              (funcall (cdr mode-entry))
-            (subed-tsv-mode))))
-      (subed-subtitle-list))))
+                       (let ((subed-auto-play-media nil))
+                               (insert-file-contents filename)
+                               (if mode-func
+                                               (funcall mode-func)
+                                       (let ((mode-entry
+                                                                (seq-find 
(lambda (mode-alist)
+                                                                               
                                 (string-match (car mode-alist) filename))
+                                                                               
                         auto-mode-alist)))
+                                               (if mode-entry
+                                                               (funcall (cdr 
mode-entry))
+                                                       (subed-tsv-mode))))
+                               (subed-subtitle-list)))))
 
 (defun subed-subtitle ()
   "Return the subtitle at point as a list.
diff --git a/subed/subed.el b/subed/subed.el
index ec5a06b415..f157a3b6cc 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.27
+;; Version: 1.0.28
 ;; 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]