diff options
author | Michael Olson <mwolson@gnu.org> | 2006-01-04 06:10:00 +0000 |
---|---|---|
committer | Michael Olson <mwolson@gnu.org> | 2006-01-04 06:10:00 +0000 |
commit | 7fe71e6381915e775deed571f7b5c0babdf0f394 (patch) | |
tree | 1e8a2b50a9a1e80748917a8c093fd604aee28bda /emms-playing-time.el | |
parent | 76389c6781d42947ce36fa8b260391935532a941 (diff) |
Use timers in a way that is compatible with both Emacs and XEmacs.
darcs-hash:20060104061024-1bfb2-a35972f84a96c27a9a4bee6a245a8cbe2d6a8dd1.gz
Diffstat (limited to 'emms-playing-time.el')
-rw-r--r-- | emms-playing-time.el | 8 |
1 files changed, 6 insertions, 2 deletions
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." |