From aa3357403153100484561cb7235fffc3faccfb00 Mon Sep 17 00:00:00 2001 From: Mike Kazantsev Date: Tue, 3 Sep 2019 01:07:37 +0500 Subject: * lisp/emms-player-mpv.el: limit emacs issue #3190 workaround to emacs 26.1 (fixed in 26.2+) --- lisp/emms-player-mpv.el | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lisp/emms-player-mpv.el b/lisp/emms-player-mpv.el index 51cbb95..54a650f 100644 --- a/lisp/emms-player-mpv.el +++ b/lisp/emms-player-mpv.el @@ -237,9 +237,11 @@ to indicate that playback should stop instead of switching to next track.") "Delay before issuing `emms-player-stopped' when mpv unexpectedly goes idle.") -(defvar emms-player-mpv-ipc-conn-emacs-26-workaround (>= emacs-major-version 26) - "Non-nil to enable workaround for issue #31901 in emacs 26.0-26.1 and possibly later versions. -These seem to fail to call sentinel function for unix socket network processes +(defvar emms-player-mpv-ipc-conn-emacs-26.1-workaround + (and (= emacs-major-version 26) + (= emacs-minor-version 1)) + "Non-nil to enable workaround for issue #31901 in emacs 26.1. +Emacs 26.1 fails to indicate missing socket file error for unix socket network processes that were started with :nowait t, so blocking connections are used there instead.") @@ -452,8 +454,12 @@ MEDIA-ARGS are used instead of --idle, if specified." (cdr DELAYS) gets passed to next connection attempt, so it can be rescheduled further until function runs out of DELAYS values. Sets `emms-player-mpv-ipc-proc' value to resulting process on success." + ;; Note - emacs handles missing unix socket files in different ways between versions: + ;; emacs <26 returns nil, emacs 26.1 leaves process in a stuck 'open + ;; state (see issue #31901), emacs 26.2+ sets 'file-missing status. + ;; None of these cases call sentinel function, so status must also be checked here. (emms-player-mpv-debug-msg "ipc: connect-delay %s" (car delays)) - (let ((use-nowait (not emms-player-mpv-ipc-conn-emacs-26-workaround))) + (let ((use-nowait (not emms-player-mpv-ipc-conn-emacs-26.1-workaround))) (setq emms-player-mpv-ipc-proc (condition-case nil (make-network-process @@ -467,6 +473,8 @@ Sets `emms-player-mpv-ipc-proc' value to resulting process on success." :filter #'emms-player-mpv-ipc-filter :sentinel #'emms-player-mpv-ipc-sentinel) (file-error nil))) + (unless (process-live-p emms-player-mpv-ipc-proc) + (setq emms-player-mpv-ipc-proc nil)) (when (and emms-player-mpv-ipc-proc (not use-nowait)) (emms-player-mpv-ipc-sentinel emms-player-mpv-ipc-proc 'open))) (when (and (not emms-player-mpv-ipc-proc) @@ -736,8 +744,7 @@ Called before `emms-player-mpv-event-functions' and does same thing as these hoo (defun emms-player-mpv-cmd (cmd &optional handler) "Send mpv command to process/connection if both are running, or otherwise schedule start/connect and set -`emms-player-mpv-ipc-start-track' for `emms-player-mpv-ipc-sentinel'. -PROC can be specified to avoid `emms-player-mpv-ipc' call." +`emms-player-mpv-ipc-start-track' for `emms-player-mpv-ipc-sentinel'." (setq emms-player-mpv-ipc-connect-command nil) (let ((proc (emms-player-mpv-ipc))) (if proc -- cgit v1.2.3 From b136d63c252aa9e9a09fcee561fe86c4aab92f20 Mon Sep 17 00:00:00 2001 From: Bruno Félix Rezende Ribeiro Date: Mon, 2 Sep 2019 23:12:19 -0300 Subject: * lisp/emms-volume.el: Fix missing quote in emms-volume-change-function --- lisp/emms-volume.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emms-volume.el b/lisp/emms-volume.el index 99c8c28..1b3981e 100644 --- a/lisp/emms-volume.el +++ b/lisp/emms-volume.el @@ -63,7 +63,7 @@ (cond ((executable-find "amixer") 'emms-volume-amixer-change) ((executable-find "pactl") 'emms-volume-pulse-change) - ((executable-find "mixerctl") emms-volume-mixerctl-change) + ((executable-find "mixerctl") 'emms-volume-mixerctl-change) ((t #'(lambda (amount) (user-error "%s" "No supported mixer found. Please, define ‘emms-volume-change-function’."))))) "*The function to use to change the volume. If you have your own functions for changing volume, set this." -- cgit v1.2.3