aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Xu <william.xwl@gmail.com>2007-03-20 11:57:00 +0000
committerWilliam Xu <william.xwl@gmail.com>2007-03-20 11:57:00 +0000
commite364b1999d4dde5a54e212792b987600ee7c5813 (patch)
tree00b42e083fbbda68411b936c20183a128dc09b5d
parent328701f03d5128ba40ade0565025ba07d319ffab (diff)
emms-mode-line.el: Make `emms-mode-line-toggle' just work..
darcs-hash:20070320115727-cfa61-0ee8c7a2aa79be18ebfae19b7a6596e9fb84ae11.gz
-rw-r--r--emms-mode-line.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/emms-mode-line.el b/emms-mode-line.el
index 5e3233f..3ae653a 100644
--- a/emms-mode-line.el
+++ b/emms-mode-line.el
@@ -68,10 +68,10 @@
"Turn on `emms-mode-line' if ARG is positive, off otherwise."
(interactive "p")
(or global-mode-string (setq global-mode-string '("")))
- (setq emms-mode-line-active-p arg)
(if (and arg (> arg 0))
(progn
- (add-hook 'emms-track-updated-functions 'emms-mode-line-alter)
+ (setq emms-mode-line-active-p t)
+ (add-hook 'emms-track-updated-functions 'emms-mode-line-alter)
(add-hook 'emms-player-finished-hook 'emms-mode-line-blank)
(add-hook 'emms-player-stopped-hook 'emms-mode-line-blank)
(add-hook 'emms-player-started-hook 'emms-mode-line-alter)
@@ -81,6 +81,7 @@
(append global-mode-string
'(emms-mode-line-string))))
(when emms-player-playing-p (emms-mode-line-alter)))
+ (setq emms-mode-line-active-p nil)
(remove-hook 'emms-track-updated-functions 'emms-mode-line-alter)
(remove-hook 'emms-player-finished-hook 'emms-mode-line-blank)
(remove-hook 'emms-player-stopped-hook 'emms-mode-line-blank)