summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-11-18 13:12:46 +0800
committerJSDurand <mmemmew@gmail.com>2022-11-18 13:12:46 +0800
commit58f38d32aaa326320798c938b50a0040279f150a (patch)
treeaa647a55d45cdb8409d32b07002df8e5460069f7
parent453fa79ea92070df959e6e913ee89737663b8d95 (diff)
bongo: safely exiting
* durand-bongo.el (durand-bongo-stop-and-exit): Stop the subtitle related things just in case. (durand-bongo-sub-stop): Avoid setting nil.
-rw-r--r--durand-bongo.el24
1 files changed, 14 insertions, 10 deletions
diff --git a/durand-bongo.el b/durand-bongo.el
index a3c9ba5..6eded4b 100644
--- a/durand-bongo.el
+++ b/durand-bongo.el
@@ -574,6 +574,7 @@ Modified by Durand."
(defun durand-bongo-stop-and-exit ()
"Stop playing and exit and kill the buffer."
(interactive)
+ (durand-bongo-sub-stop)
(bongo-stop)
(bongo-erase-buffer)
(cond
@@ -776,17 +777,20 @@ will do the right renaming."
(interactive)
(durand-bongo-sub-stop-timer bongo-player)
(with-bongo-playlist-buffer
- (bongo-player-put bongo-player 'sub-time nil)
(cond
- ((buffer-live-p
- (bongo-player-get bongo-player 'sub-file-buffer))
- (kill-buffer
- (bongo-player-get bongo-player 'sub-file-buffer))
- (bongo-player-put bongo-player 'sub-file-buffer nil)))
- (cond
- ((buffer-live-p durand-bongo-sub-buffer)
- (kill-buffer durand-bongo-sub-buffer)
- (setq durand-bongo-sub-buffer nil)))))
+ ((bongo-player-get bongo-player 'sub-time)
+ (bongo-player-put bongo-player 'sub-time nil)
+ (bongo-player-put bongo-player 'sub-bound nil)
+ (cond
+ ((buffer-live-p
+ (bongo-player-get bongo-player 'sub-file-buffer))
+ (kill-buffer
+ (bongo-player-get bongo-player 'sub-file-buffer))
+ (bongo-player-put bongo-player 'sub-file-buffer nil)))
+ (cond
+ ((buffer-live-p durand-bongo-sub-buffer)
+ (kill-buffer durand-bongo-sub-buffer)
+ (setq durand-bongo-sub-buffer nil)))))))
;;;; Find the subtitles file and load into a buffer