From 58f38d32aaa326320798c938b50a0040279f150a Mon Sep 17 00:00:00 2001 From: JSDurand Date: Fri, 18 Nov 2022 13:12:46 +0800 Subject: 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. --- durand-bongo.el | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'durand-bongo.el') 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 -- cgit v1.2.3-18-g5258