[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mpv 899559ae77 04/50: some fixes
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mpv 899559ae77 04/50: some fixes |
Date: |
Tue, 28 Dec 2021 00:58:34 -0500 (EST) |
branch: elpa/mpv
commit 899559ae77a4ead96358b5845cb39f1c471566f5
Author: Johann Klähn <kljohann@gmail.com>
Commit: Johann Klähn <kljohann@gmail.com>
some fixes
---
mpv-mode.el | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/mpv-mode.el b/mpv-mode.el
index 9e9276af88..02ce91de57 100644
--- a/mpv-mode.el
+++ b/mpv-mode.el
@@ -44,11 +44,12 @@
(and -process (eq (process-status -process) 'run)))
(defun -start (&rest args)
- (-kill)
+ (kill)
(let ((socket (make-temp-name
(expand-file-name "mpv-mode-" temporary-file-directory))))
(setq -process
(apply #'start-process "mpv-player" nil executable
+ "--no-terminal"
(concat "--input-unix-socket=" socket) args))
(set-process-query-on-exit-flag -process nil)
(while (and (-alive-p) (not (file-exists-p socket)))
@@ -63,11 +64,13 @@
(-tq-filter -queue string)))
t))
-(defun -kill ()
- (when (-alive-p)
- (kill-process -process))
+(defun kill ()
+ "Kill the mpv process."
+ (interactive)
(when -queue
(tq-close -queue))
+ (when (-alive-p)
+ (kill-process -process))
(setq -process nil)
(setq -queue nil))
@@ -80,12 +83,13 @@ the process has finished replying to any previous questions.
This produces more reliable results with some processes.
Note that we do not use the regexp and closure arguments of
-`-tq-enque', see our custom implementation of `tq-process-buffer'
+`tq-enqueue', see our custom implementation of `tq-process-buffer'
below."
- (tq-enqueue
- -queue
- (concat (json-encode `((command . ,command))) "\n")
- "" nil fn delay-command))
+ (when (-alive-p)
+ (tq-enqueue
+ -queue
+ (concat (json-encode `((command . ,command))) "\n")
+ "" nil fn delay-command)))
(defun -tq-filter (tq string)
(let ((buffer (tq-buffer tq)))
@@ -107,7 +111,7 @@ drops unsolicited event messages."
;; event messages have form {"event": ...}
;; answers have form {"error": ..., "data": ...}
;; FIXME: handle errors?
- (unless (assoc 'event answer)
+ (unless (or (assoc 'event answer) (tq-queue-empty tq))
(unwind-protect
(condition-case nil
(funcall (tq-queue-head-fn tq)
- [nongnu] branch elpa/mpv created (now 9bd6d36cc7), ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 899559ae77 04/50: some fixes,
ELPA Syncer <=
- [nongnu] elpa/mpv ee505feff0 16/50: add .gitignore, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 0a02225f4e 30/50: autoload all interactive functions, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 27b98410e5 45/50: Fix decreasing volume or speed by multiple steps, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 8da5b19f3d 07/50: cleanup, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 91b094c966 02/50: initial import, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv f0da905fd3 06/50: implement pausing and inserting playback position, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 6338f0d6b5 12/50: rename to mpv.el, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv e3fad297cd 18/50: add README.md, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv c6b3fa013c 36/50: Add mpv-run-command function to synchronously run commands, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 9dedf3b7c1 34/50: Monkey-patch org-timer-item instead of reimplementing, ELPA Syncer, 2021/12/28