[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/emms caa744d 72/80: * emms-player-mplayer.el: lexical d
From: |
Stefan Monnier |
Subject: |
[elpa] externals/emms caa744d 72/80: * emms-player-mplayer.el: lexical declaration, deprecate emms-player-mpv-cmd-prog macro |
Date: |
Wed, 17 Mar 2021 18:42:33 -0400 (EDT) |
branch: externals/emms
commit caa744dd2c05ad16eaebf19f54d57fb670af96c5
Author: Mike Kazantsev <mk.fraggod@gmail.com>
Commit: fraggod@malediction <mk.fraggod@gmail.com>
* emms-player-mplayer.el: lexical declaration, deprecate
emms-player-mpv-cmd-prog macro
---
emms-player-mpv.el | 33 +++++++++++++++++++--------------
1 file changed, 19 insertions(+), 14 deletions(-)
diff --git a/emms-player-mpv.el b/emms-player-mpv.el
index c4fc541..7d9099a 100644
--- a/emms-player-mpv.el
+++ b/emms-player-mpv.el
@@ -1,4 +1,4 @@
-;;; emms-player-mpv.el --- mpv support for EMMS
+;;; emms-player-mpv.el --- mpv support for EMMS -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2018 Free Software Foundation, Inc.
@@ -130,7 +130,7 @@ depending on `emms-player-mpv-ipc-method' value and/or mpv
version."
"Update track duration when played by mpv.
Uses `emms-player-mpv-event-functions' hook."
:type 'boolean
- :set (lambda (sym value)
+ :set (lambda (_sym value)
(run-at-time 0.1 nil
(lambda (value)
(if value
@@ -148,7 +148,7 @@ Uses `emms-player-mpv-event-functions' hook."
This allows to dynamically update stream info from ICY tags, for example.
Uses `emms-player-mpv-event-connect-hook' and
`emms-player-mpv-event-functions' hooks."
:type 'boolean
- :set (lambda (sym value)
+ :set (lambda (_sym value)
(run-at-time 0.1 nil
(lambda (value)
(if value
@@ -213,7 +213,7 @@ Should be fine with both mpv and emacs, and probably never
reached anyway.")
(defvar emms-player-mpv-ipc-stop-command nil
"Internal flag to track when stop command starts/finishes before next
loadfile.
Set to either nil, t or playback start function to call on end-file event
after stop command.
-This is a workaround for mpv-0.30+ behavior, when 'stop + loadfile' only runs
'stop'.")
+This is a workaround for mpv-0.30+ behavior, where 'stop + loadfile' only runs
'stop'.")
(defvar emms-player-mpv-event-connect-hook nil
@@ -315,7 +315,7 @@ Error is signaled if mpv binary fails to run."
'file)
((pred (string> "000.016.999"))
'unix-socket)
- (- 'ipc-server)))))
+ (_ 'ipc-server)))))
;; ----- mpv process
@@ -572,7 +572,7 @@ PROC can be specified to avoid `emms-player-mpv-ipc' call
(e.g. from sentinel/fi
(let ((json (concat (json-encode (list :command cmd :request_id req-id))
"\n")))
(emms-player-mpv-debug-msg "json >> %s" json)
- (condition-case err
+ (condition-case _err
;; On any disconnect, assume that mpv process is to blame and force
restart.
(process-send-string req-proc json)
(error
@@ -591,7 +591,7 @@ PROC can be specified to avoid `emms-player-mpv-ipc' call
(e.g. from sentinel/fi
(remhash req-id emms-player-mpv-ipc-req-table)
(when handler (funcall handler data err)))))
-(defun emms-player-mpv-ipc-req-error-printer (data err)
+(defun emms-player-mpv-ipc-req-error-printer (_data err)
"Simple default `emms-player-mpv-ipc-req-send' handler to log errors, if
any."
(when err (message "emms-player-mpv ipc-error: %s" err)))
@@ -765,32 +765,37 @@ or otherwise schedule start/connect and set
(setq emms-player-mpv-ipc-connect-command cmd))))
(defmacro emms-player-mpv-cmd-prog (cmd &rest handler-body)
- "Macro around `emms-player-mpv-cmd' that creates
+ "Obsolete macro around `emms-player-mpv-cmd' that creates
handler callback (see `emms-player-mpv-ipc-req-send') from HANDLER-BODY forms,
which have following bindings:
- mpv-cmd for CMD.
- mpv-data for response data (decoded json, nil if none).
-- mpv-error for response error (nil if no error, decoded json or
'connection-error)."
+- mpv-error for response error (nil if no error, decoded json or
'connection-error).
+
+Do not use it with new code - it will raise warnings when used with lexical
bindings,
+and will be removed in a future EMMS version."
`(emms-player-mpv-cmd ,cmd (apply-partially
(lambda (mpv-cmd mpv-data mpv-error)
,@handler-body)
,cmd)))
+(make-obsolete 'emms-player-mpv-cmd-prog nil "Emms 7")
+
(defun emms-player-mpv-playable-p (track)
(memq (emms-track-type track)
'(file url streamlist playlist)))
-(defun emms-player-mpv-start-error-handler (mpv-cmd mpv-data mpv-error)
+(defun emms-player-mpv-start-error-handler (mpv-cmd _mpv-data mpv-error)
"Playback-restart error handler for `emms-player-mpv-cmd',
to restart/reconnect-to mpv and re-run MPV-CMD,
if there was any issue when trying to start it initially."
(if (eq mpv-error 'connection-error)
;; Reconnect and restart playback if current connection fails (e.g. mpv
crash)
- (emms-player-mpv-cmd-prog
- (emms-player-mpv-cmd mpv-cmd)
- (emms-player-mpv-cmd `(set pause no)))
- (emms-player-mpv-cmd `(set pause no))))
+ (emms-player-mpv-cmd mpv-cmd
+ (lambda (_mpv-data _mpv-error)
+ (emms-player-mpv-cmd mpv-cmd)
+ (emms-player-mpv-cmd `(set pause no))))))
(defun emms-player-mpv-start (track)
(setq emms-player-mpv-stopped nil)
- [elpa] externals/emms a31d1f8 60/80: * emms-librefm-stream.el: add lexical and fix warnings, (continued)
- [elpa] externals/emms a31d1f8 60/80: * emms-librefm-stream.el: add lexical and fix warnings, Stefan Monnier, 2021/03/17
- [elpa] externals/emms 60c6172 74/80: * emms-browser.el: add-to-list -> cl-pushnew, Stefan Monnier, 2021/03/17
- [elpa] externals/emms e16ac3d 78/80: Set new default info methods in emms-all, Stefan Monnier, 2021/03/17
- [elpa] externals/emms d7110c0 67/80: * emms-player-simple.el: lexical declaration and fix, Stefan Monnier, 2021/03/17
- [elpa] externals/emms 58c949b 69/80: * emms-playing-time.el: add lexical and fix, Stefan Monnier, 2021/03/17
- [elpa] externals/emms 6a5c7b1 73/80: * emms-browser.el: fix unused lexical variables and arguments, Stefan Monnier, 2021/03/17
- [elpa] externals/emms f268b28 77/80: Miscellaneous small fixes to manual chapter 13, Stefan Monnier, 2021/03/17
- [elpa] externals/emms de0c407 80/80: * emms.info: new info, Stefan Monnier, 2021/03/17
- [elpa] externals/emms 4b97340 06/80: * emms-tag-editor.el: remove hard-coding of program name, Stefan Monnier, 2021/03/17
- [elpa] externals/emms 35d503c 68/80: add lexical declarations, Stefan Monnier, 2021/03/17
- [elpa] externals/emms caa744d 72/80: * emms-player-mplayer.el: lexical declaration, deprecate emms-player-mpv-cmd-prog macro,
Stefan Monnier <=
- [elpa] externals/emms e72fb7c 79/80: Merge branch 'info-native', Stefan Monnier, 2021/03/17
- [elpa] externals/emms 50c5f8e 59/80: * emms-librefm-scrobbler.el: add lexical declaration, Stefan Monnier, 2021/03/17
- [elpa] externals/emms a6f8461 76/80: Use two-column tables in manual chapter 13, Stefan Monnier, 2021/03/17