aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emms-lyrics.el2
-rw-r--r--emms-playing-time.el8
-rw-r--r--emms.el8
3 files changed, 15 insertions, 3 deletions
diff --git a/emms-lyrics.el b/emms-lyrics.el
index 7f17981..ebbfc12 100644
--- a/emms-lyrics.el
+++ b/emms-lyrics.el
@@ -178,7 +178,7 @@ To find FILE, will look up in current directory and `emms-lyrics-dir'."
"Stop displaying lyrics."
(interactive)
(when emms-lyrics-alist
- (cancel-function-timers 'emms-lyrics-display)
+ (mapc #'emms-cancel-timer emms-lyrics-timers)
(if (or (not emms-player-paused-p)
emms-player-stopped-p)
(setq emms-lyrics-alist nil
diff --git a/emms-playing-time.el b/emms-playing-time.el
index 36090e0..ad2da90 100644
--- a/emms-playing-time.el
+++ b/emms-playing-time.el
@@ -69,6 +69,8 @@ should enable `emms-playing-time-display-p' first, though."
(defvar emms-playing-time-string "")
+(defvar emms-playing-time-display-timer nil)
+
(defun emms-playing-time-start ()
"Get ready for display playing time."
(setq emms-playing-time 0)
@@ -81,13 +83,15 @@ should enable `emms-playing-time-display-p' first, though."
(progn
(setq emms-playing-time-string "")
(force-mode-line-update)))
- (cancel-function-timers 'emms-playing-time-display))
+ (emms-cancel-timer emms-playing-time-display-timer)
+ (setq emms-playing-time-display-timer nil))
(defun emms-playing-time-pause ()
"Pause playing time."
(if emms-player-paused-p
(emms-playing-time-stop)
- (run-at-time t 1 'emms-playing-time-display)))
+ (setq emms-playing-time-display-timer
+ (run-at-time t 1 'emms-playing-time-display))))
(defun emms-playing-time-seek (sec)
"Seek forward or backward SEC playing time."
diff --git a/emms.el b/emms.el
index 73dfd86..e17f8eb 100644
--- a/emms.el
+++ b/emms.el
@@ -363,6 +363,14 @@ See `emms-repeat-track'."
(when (not emms-player-playing-p)
(error "No EMMS player playing right now")))
+(defun emms-cancel-timer (timer)
+ "Cancel the given TIMER."
+ (when timer
+ (cond ((fboundp 'cancel-timer)
+ (cancel-timer timer))
+ ((fboundp 'delete-itimer)
+ (delete-itimer timer)))))
+
;;; Tracks