From 0f9bc54e22819255a02758850bd940491923b7ce Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Thu, 29 Apr 2021 12:33:11 -0400 Subject: *.el: Avoid the obsolete `defadvice` system * emms.el: Require `nadvice` for compatibility with Emacs<24.4. * emms-player-vlc.el (emms-player-vlc-start): Use `advice-add` rather than `defadvice`. patch by Stefan Monnier --- emms-browser.el | 10 ++++++---- emms-player-vlc.el | 7 ++++--- emms.el | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/emms-browser.el b/emms-browser.el index 1ae727b..fcb4ef3 100644 --- a/emms-browser.el +++ b/emms-browser.el @@ -190,10 +190,12 @@ ;; artist->track instead of artist->album->track when you switch to ;; the 'singles' filter. -;; (defadvice emms-browser-next-mapping-type -;; (after no-album (current-mapping)) -;; (when (eq ad-return-value 'info-album) -;; (setq ad-return-value 'info-title))) +;; (advice-add 'emms-browser-next-mapping-type :around #'my-emms--types) +;; (defun my-emms--types (orig-fun &rest args) +;; (let ((type (apply orig-fun args))) +;; (if (eq type 'info-album) +;; 'info-title) +;; type))) ;; (defun toggle-album-display () ;; (if (string= emms-browser-current-filter-name "singles") diff --git a/emms-player-vlc.el b/emms-player-vlc.el index 7a502cd..060f0d8 100644 --- a/emms-player-vlc.el +++ b/emms-player-vlc.el @@ -43,14 +43,15 @@ ;; track, so the player sentinel has no way of telling that the next ;; track should be played. Therefore I redefine this low-level ;; function and add a "quit" track which is invisible to Emms. -(defadvice emms-player-vlc-start (around quit-vlc-after-finish activate) - (let ((process (apply 'start-process +(advice-add 'emms-player-vlc-start :override #'emms--vlc-quit-after-finish) +(defun emms--vlc-quit-after-finish (track &rest _) + (let ((process (apply #'start-process emms-player-simple-process-name nil emms-player-vlc-command-name ;; splice in params here (append emms-player-vlc-parameters - (list (emms-track-name (ad-get-arg 0))) + (list (emms-track-name track)) '("vlc://quit"))))) ;; Add a sentinel for signaling termination. (set-process-sentinel process #'emms-player-simple-sentinel)) diff --git a/emms.el b/emms.el index d2c9662..8c950b1 100644 --- a/emms.el +++ b/emms.el @@ -7,7 +7,7 @@ ;; Version: 7.1 ;; Keywords: emms, mp3, ogg, flac, music, mpeg, video, multimedia ;; Package-Type: multi -;; Package-Requires: ((cl-lib "0.5") (seq)) +;; Package-Requires: ((cl-lib "0.5") (nadvice "0.3") (seq)) ;; url: https://www.gnu.org/software/emms/ ;; This file is part of EMMS. -- cgit v1.2.3