aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoni Rabkin <yoni@rabkins.net>2021-04-29 12:33:11 -0400
committerYoni Rabkin <yoni@rabkins.net>2021-04-29 12:33:11 -0400
commit0f9bc54e22819255a02758850bd940491923b7ce (patch)
treeae5a6ba69686fa82dabd5f179fe944e8822deb73
parent7263ea6f64b1bbf4de89cac6501be2e5d8e3fe9c (diff)
*.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
-rw-r--r--emms-browser.el10
-rw-r--r--emms-player-vlc.el7
-rw-r--r--emms.el2
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.